CBSE Class 12 Informatics Practices Question 43 of 101

Python Pandas — II — Question 19

Back to all questions
19
Question

Question 19

To get bottom 3 rows of a DataFrame, you may use ............... function.

  1. tail()
  2. tail(3)
  3. bottom()
  4. bottom(3)
Answer

tail(3)

Reason — The tail() function in pandas is used to get the bottom n rows of a DataFrame, where n is an optional argument. Hence, tail(3) is correct and will return the bottom 3 rows of the DataFrame.