seting reseting pandas dataFrame column name not working

import numpy as np
import pandas as pd
randArr =np.random.randint(0,100,20).reshape(5,4) 
df =pd.DataFrame(randArr,np.arange(101,106,1),['PDS','Algo','SE','INS'])'RollNo')

Traceback (most recent call last):
File "D:/Education/4th year/1st sem/Machine Learning Lab/1st Lab/python/pandas/", line 25, in‘RollNo’)
TypeError: ‘NoneType’ object is not callable

>Solution :

You need to set the index name as follows: = 'RollNo'

There is no such thing as'RollNo')

That’s the where the Type Error comes from.

Leave a Reply