机器学习
qq_24986343
这个作者很懒,什么都没留下…
展开
-
python np.loadtxt
>>> import numpy as np >>> data = np.loadtxt('m50_1.txt', dtype=np.uint64) >>> print data [2222 3333 4444 5555] 说明把m50_1.txt进行读取,并且表示成矩阵的形式(类似matlab)原创 2017-12-04 21:03:30 · 719 阅读 · 0 评论 -
python reshape -1
z.reshape(-1) array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) z.reshape(-1, 1) 也就是说,先前我们不知道z的shape属性是多少,但是想让z变成只有一列,行数不知道多少,通过`z.reshape(-1,1)`,Numpy自动计算出有12行,新的数组shape属性为原创 2017-12-05 10:56:59 · 846 阅读 · 0 评论