CBSE Class 12 Informatics Practices Question 53 of 167

Python Pandas — I — Question 18

Back to all questions
18
Question

Question 18

Given a Pandas series called Sequences, the command which will display the first 4 rows is ............... .

  1. print(Sequences.head(4))
  2. print(Sequences.Head(4))
  3. print(Sequences.heads(4)
  4. print(Sequences.Heads(4))
Answer

print(Sequences.head(4))

Reason — The syntax to display the first n rows from a Series object is <Series object>.head([n]). Therefore, according to this syntax, the command to display the first 4 rows of Sequences is print(Sequences.head(4)).