Q. Find the error in the following code considering the same dataframe topDf given in the question.

Q. Find the error in the following code? Suggest the solution.


>>> topDf

      Rollno  Name  Marks

Sec A  115  Pavni  97.5

Sec B  236  Rishi    98.0

Sec C  307  Preet  98.5

Sec D  422  Paula  98.0

>>> topDf.del['Sec D']

 


(i) topdf.rename(index=['a', 'b', 'c', 'd'])

(ii) topdf.rename(columns = {})


Answer =

(i) To rename index
Index argument must be a dictionary

(ii) No error

2 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post