Python TypeError: 'list' object is not callable
<pre><code># -*- 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
</code></pre>

<hr>

<pre><code>TypeError Traceback (most recent call last)
“for i in range(len(file.index)):”

TypeError: 'list' object is not callable
</code></pre>