Python TypeError:' list'对象不可调用

时间:2016-11-13 09:14:00

标签: python list dataframe

# -*- coding:utf-8 -*-
import codecs
import numpy as np
import csv
import pandas as pd*
nons_file=pd.read_csv(r'C:\Users\roy\Desktop\Bighomework\new\non_subscibe\session.csv')
s_file=pd.read_csv(r'C:\Users\roy\Desktop\Bighomework\new\subscribe\session1.csv')
s_file['subscribe'] = 1
nons_file['subscribe'] = 0
file=s_file.append(nons_file, ignore_index=False, verify_integrity=False)

id_dict={}
count=0
for i in range(len(file.index)):
    if file[i].id not in id_dict:
        count+=1
        file[i].id
        id_dict[id]=count
    else: file[i].id=id_dict[id]
id_dict={}
count=0
TypeError Traceback (most recent call last)
“for i in range(len(file.index)):”

TypeError: 'list' object is not callable

0 个答案:

没有答案