# coding=utf-8 import numpy as np file_path = "C:/Users/lenovo/Desktop/1.csv" t1 = np.loadtxt(file_path,delimiter=",",dtype="int",unpack=True) t=[1,2,3,4,5,6] print(t1) print("*"*100) #取第三行 print(t1[2]) #取第三行及后面所有行 print(t1[2:]) #取不连续的多行;注意方括号的使用 print(t1[[2,5,7]]) print("*"*100) #取列 print(t1[:,2]) #取连续的多列 print(t1[:,2:])