numpy_读取文件
读取文件
# author: Roy.G
import numpy as np
import matplotlib.pyplot as mp
data1,data2,data3,data4=np.loadtxt(
'aa.csv',
encoding='utf-8-sig', #当使用utf-8时,会出现\ufeff,用-sig解决问题
delimiter=',',
usecols= (0,1,2,3),
dtype ='U18,f8,f8,f8',
unpack =True #拆包
)
print(data2)
t=np.arange(0,len(data3))
mp.plot(data1,data3)
mp.show()