目录:
1、数组
import numpy as np
t1=np.arange(0,24).reshape(4,6);print(t1)
t2=np.arange(0,6);print(t2)
t=t1-t2
print(t)
t.shape
####################
[[ 0 1 2 3 4 5]
[ 6 7 8 9 10 11]
[12 13 14 15 16 17]
[18 19 20 21 22 23]]
[0 1 2 3 4 5]
[[ 0 0 0 0 0 0]
[ 6 6 6 6 6 6]
[12 12 12 12 12 12]
[18 18 18 18 18 18]]
(4, 6)
2、读取数据
#读取文件
import numpy as np
data=np.loadtxt(frame,dtype=np.float,delimiter=",",