How can I get the number of rows of a Pandas DataFrame in Python?
We can do this in one of two main ways:
row_count = len(my_dataframe)
DataFrame.shapeproperty, which contains a tuple of the row and column count:
row_count = my_dataframe.shape
len() function is usually the faster of the two solutions, but
shape may be useful in circumstances where we also need the column count.