尝试拆分csv继续获取'DataFrame'对象没有属性'split'错误

时间:2019-04-20 12:49:49

标签: python csv split classification

我正在尝试为我的图像分类器构建一个字典,但是当我继续尝试csv的每一行时,出现“数据框没有属性拆分”错误

naimg_dict = {} 
f = pd.read_csv(io.BytesIO(uploaded['training.csv']))
fileContents = pd.read_csv(io.BytesIO(uploaded['training.csv']))
fileContents = fileContents.split('\n') #This is where I get the error

for i in range(len(fileContents)-1):
  fileContents[i] = fileContents[i].split(',')
  naming_dict[fileContents[i][0]] = fileContents[i][1]

0 个答案:

没有答案