I’m working with a Pandas DataFrame and I need to get the number of rows in the DataFrame. I know I can use the len()
function to get the number of rows, but I’m wondering if there are any alternative methods that I can use.
Here’s a toy dataset that I’m working with:
In this code, I define a toy dataset df with five rows and three columns (‘Name’, ‘Age’, and ‘Gender’). Can someone please suggest some alternative methods that I can use to get the row count of this DataFrame? I’m open to any suggestions. Thank you!