csv文件的保存与读取
import numpy as np
import pandas as pd
# 保存数据到csv文件
m = np.arange(16).reshape((4,4))
data = pd.DataFrame(m)
data.to_csv('demo.csv',header=False,index=False)
# 从csv文件读取数据
# skiprows=0不跳行, usecols=None读取所有列, unpack=False不转置
a = np.loadtxt('demo.csv', dtype="float", delimiter=',', skiprows=2, usecols=None, unpack=False)
print(a)