CBSE Class 12 Informatics Practices Question 46 of 167

Python Pandas — I — Question 11

Back to all questions
11
Question

Question 11

To display last five rows of a Series object S, you may write ............... .

  1. head()
  2. head(5)
  3. tail()
  4. tail(5)
Answer

tail(), tail(5)

Reason — The syntax to display the last n rows of a Series object is <Series Object>.tail([n]). Therefore, according to this syntax, tail(5) will display last five rows of a Series object S. If n value is not specified, then tail() will return the last 5 rows of a Series object.