CBSE Class 12 Informatics Practices
Question 99 of 167
Python Pandas — I — Question 10
Back to all questionsThe error in Hitesh's code is that the tail() function in pandas by default returns the last 5 rows of the dataframe. To display the last 4 rows, Hitesh needs to specify the number of rows he wants to display.
Here's the correct code:
df.tail(4)