一,轴的概念
可根据数组的shape属性返回的元组长度判断为几维数组
一维数组: o轴(个数)
二维数组: o轴(行),1轴(列)
三维数组: o轴(块),1轴(行),2轴(列)
二,numpy读取数组
(一般不用,一般使用pandas从数据库、剪切板中读取)
import numpy as np
file_dir = './number.csv'
# file_dir表示文件位置;delimiter表示数据之间的间隔符;dtype表示数据类型;
# unpack表示转置 按列数逐行的读取数据;
t1 = np.loadtxt(file_dir,delimiter=',',dtype='int',unpack=True)
t2 = np.loadtxt(file_dir,delimiter=',',dtype='int')
print(t1)
print('-'*50)
print(t2)