Scipy的学习手记

来源:互联网 发布:淘宝点击量是什么意思 编辑:程序博客网 时间:2024/05/17 07:18
In [1]: import scipyIn [2]: scipy.version.full_versionOut[2]: '0.17.1'In [3]: pwdOut[3]: u'C:\\Users\\xuedagong\\Documents'In [4]: import scipy as spIn [6]: data=sp.genfromtxt("web_traffic.tsv",delimiter="\t")In [7]: print ( data[:10])[[  1.00000000e+00   2.27200000e+03] [  2.00000000e+00              nan] [  3.00000000e+00   1.38600000e+03] [  4.00000000e+00   1.36500000e+03] [  5.00000000e+00   1.48800000e+03] [  6.00000000e+00   1.33700000e+03] [  7.00000000e+00   1.88300000e+03] [  8.00000000e+00   2.28300000e+03] [  9.00000000e+00   1.33500000e+03] [  1.00000000e+01   1.02500000e+03]]In [8]: print(data.shape)(743L, 2L)In [9]: x=data[:,0]In [10]: print(x[:10])[  1.   2.   3.   4.   5.   6.   7.   8.   9.  10.]In [11]: y=data[:,1]In [12]: print(y[:10])[ 2272.    nan  1386.  1365.  1488.  1337.  1883.  2283.  1335.  1025.]
0 0
原创粉丝点击