KnowledgeBoat Logo
|

Informatics Practices

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))

Python Pandas

1 Like

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)).

Answered By

2 Likes


Related Questions