TypeError: 'function' object is not subscriptable how to resolve this error while reading csv file

TypeError: 'function' object is not subscriptable how to resolve this error while reading csv file

when I am writing this code


test_df1=pd.read_csv[CSVFILE]

it show the below error

Traceback (most recent call last):

  File "<ipython-input-13-cb3d7014d176>", line 1, in <module>
    test_df1=pd.read_csv[CSVFILE]

TypeError: 'function' object is not subscriptable

how to resolve this

而不是

test_df1=pd.read_csv[CSVFILE]

因为 read_csv() 是一个方法所以它被 () 调用而不是 []

所以使用 :-

df1=pd.read_csv('CSVFILE.csv')