添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
import csv
import pandas as pd

with open('D:\Data\新建文件夹\list3.2.csv','r') as csvfile:
reader = csv.reader(csvfile)
column1 = [row[1]for row in reader]
print(column1)


# 下面是按照列属性读取的
d = pd.read_csv('D:\Data\新建文件夹\list3.2.csv', usecols=['case', 'roi', 'eq. diam.','x loc.','y loc.','slice no.'])
print(d)

d = pd.read_csv('D:\Data\新建文件夹\list3.2.csv', usecols=['case', 'roi', 'eq. diam.','x loc.','y loc.','slice no.'],
nrows=10)
# 这是表示读取前10行