上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 71 下一页

2013年8月18日

【Python】求素数-稍加优化

摘要: print 'Find prime number smaller then input number \n'print 'Please input a number:'import datetimebegintime=datetime.datetime.now()number=raw_input()num=1end=[]b=0n=0while num1:break div+=1 if n==1: end.append(num) num+=1 n=0print "The prime number smaller then %s are:\n" 阅读全文

posted @ 2013-08-18 14:48 colipso 阅读(517) 评论(0) 推荐(0) 编辑

【Python】求素数-未经过任何优化

摘要: print 'Find prime number smaller then input number \n'print 'Please input a number:'import timenumber=raw_input()num=1end=[]b=0n=0while num<int(number): div=1 while div<num: result=float(num)/div if float(result).is_integer(): n+=1 div+=1 if n==1: end... 阅读全文

posted @ 2013-08-18 14:21 colipso 阅读(213) 评论(0) 推荐(0) 编辑

2013年8月12日

【ARIMA】Autoregressive Integrated Moving Average Model

摘要: 【理论部分】ARIMA包含两部分,自回归AR和移动平均MA:AR:Y(t)-a=b(1){Y(t-1)-a}+u(t) 其中a是y的均值, u(t)是均值为零,恒定方差的不相关随机误差项(噪声)此公式为一阶自回归AR(1)随机过程。同理可以推广出P阶自回归过程。MA:Y(t)=u+c(0)u(t)+c(1)u(t-1) 其中u是常数项 u(t)是噪声。 此公式为一阶移动平均MA(1)过程。同理可推广出q阶移动平均过程。如果Y兼具Autoregressive 和 Moving Average特性的话 可以把AR和MA公式合写,此时ARMA(p,q)具有P阶自回归和q阶移动平均。上述模型应用于.. 阅读全文

posted @ 2013-08-12 09:45 colipso 阅读(1166) 评论(0) 推荐(0) 编辑

2013年8月5日

【Python】setup-转载

摘要: python+PyQT+Eric安装配置python+PyQT+Eric安装配置作者:loker博客:http://www.cnblogs.com/lhj588/时间:2011年10月3日一、大纲内容:1、预备PC环境:2、预备安装程序:2、1、下载Python3.22、2、下载PyQt42、3、下载Eric53、安装配置步骤:3、1、安装Pyhon3.23、2、安装PyQt43、3、安装Eric54、制作一个Demo:4、1、用Eric创建Demo项目4、2、在Demo项目中添加Forms,用PyQT4设计4、3、返回到Eric界面后,设计程序。二、安装配置详解1、预备PC环境:本次安装配置 阅读全文

posted @ 2013-08-05 20:55 colipso 阅读(251) 评论(0) 推荐(0) 编辑

2013年4月9日

【R】读写excel

摘要: > library(RODBC)> channel<-odbcConnectExcel("sms.xlsx")> mydata<-sqlFetch(channel,"Sheet1")> mydata> odbcClose(channel)数据首行为标题 阅读全文

posted @ 2013-04-09 12:09 colipso 阅读(217) 评论(0) 推荐(0) 编辑

2013年4月5日

【R】小计

摘要: > range(lifeexp)[1] 47.794 83.394> max(lifeexp)[1] 83.394> min(lifeexp)[1] 47.794> IQR(lifeexp)[1] 11.986> var(lifeexp)[1] 93.48446> sd(lifeexp)[1] 9.668736> sqrt(var(lifeexp))[1] 9.668736> round(sd(lifeexp),1)[1] 9.7> med=medion(lifeexp)错误: 没有"medion"这个函数> me 阅读全文

posted @ 2013-04-05 21:05 colipso 阅读(2560) 评论(0) 推荐(0) 编辑

【R】matrix

摘要: R的运算基于矩阵。> data=read.table("Data_LifeExpTable.txt")> data> lifeexp=data[,2]> plot(lifeexp)> ?plotstarting httpd help server ... done> plot(lifeexp,xlab="country",ylab="life expectancy")> plot(sort(lifeexp))> plot(sort(lifeexp),ylim=C(0,100))错误于C( 阅读全文

posted @ 2013-04-05 19:42 colipso 阅读(711) 评论(0) 推荐(0) 编辑

2013年4月1日

【R】读写excel

摘要: 转载自:http://blog.sina.com.cn/s/blog_6622f5c301013pcs.html还在纠结用如何用R读取Excel的同学有福了。昨天逛CRAN的时候发现了一个xlsx包,它给出的介绍是可以读取、写入Excel 2007/2003文件并支持格式的设置。简单地来说,将Excel读取为数据框,以及将数据框写入为Excel文件都不是问题,而更加强大的是它能处理 Excel中的格式,比如合并单元格,设置列的宽度,设置字体和颜色等等。如果只需要基本的读取/写入操作,那么其中的read.xlsx()和write.xlsx()应该就能满足大部分的需求了,其用法也很简单,看看帮助文 阅读全文

posted @ 2013-04-01 15:25 colipso 阅读(1073) 评论(0) 推荐(0) 编辑

2013年3月27日

【SAS NOTES】sas对中文的支持

摘要: 对sas文件的修改nls\en\SASV9.CFG81行找到/* SAS/SHARE APPLSYS macro library pathname */-SET SASSAML !sasext0\share\sasmacro\在后面加入-DBCSLANG CHINESE-DBCS-DBCSTYPE PCMS180行处找到/* Setup the SAS System load image search paths definition */-PATH (在下一行插入 "!sasext0\dbcs\sasex... 阅读全文

posted @ 2013-03-27 15:49 colipso 阅读(429) 评论(0) 推荐(0) 编辑

2013年3月7日

【SAS NOTE】年累计

摘要: 1 data a; 2 input date num; 3 datalines; 4 201201 1 5 201202 2 6 201203 3 7 201301 4 8 201302 5 9 ;10 run;11 data b;12 set a;13 c=substr(put(date,$6.),1,4);14 run;15 proc print data=b;16 run;17 data c;18 set a;19 retain;20 y=substr(put(date,$6.),1,4);21 m=substr(put(... 阅读全文

posted @ 2013-03-07 14:50 colipso 阅读(229) 评论(0) 推荐(0) 编辑

上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 71 下一页

导航