KnowledgeBoat Logo
|

Informatics Practices

Which of the following codes will display the total number of rows in the DataFrame stud?

  1. print (len(stud.axes[0]))
  2. print (stud.len(0) )
  3. print (stud.len [axes=0] )
  4. print (len (stud.axes[row] )

Python Pandas

2 Likes

Answer

print(len(stud.axes[0]))

Reason — The command stud.axes[0] gives access to the index labels along the 0th axis (rows) of the DataFrame stud. The len(stud.axes[0]) returns the length of this index label array, which corresponds to the total number of rows in the DataFrame stud.

Answered By

1 Like


Related Questions