English

Which of the following cammand will not show first five rows from the Pandas series named S1? - Informatics Practices

Advertisements
Advertisements

Question

Which of the following cammand will not show first five rows from the Pandas series named S1?

Options

  • S1 [0 : 5]

  • S1.head ()

  • S1.head (5)

  • S1.head [0 : 5]

MCQ

Solution

S1.head [0 : 5]

Explanation:

S1.head[0:5]: The syntax is incorrect. To use the head() function correctly, use brackets instead of square brackets. This command will return a syntax error.

S1.head(): This command displays the default number of rows from the start of the Series. By default, the head() function displays the first five rows. This will display the top five rows; however, specifying (5) is suggested for clarity. 

shaalaa.com
  Is there an error in this question or solution?
2023-2024 (February) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×