How it works...
Step 1 gives basic information on the size of the dataset. The shape attribute returns a two-element tuple of the number of rows and columns. The size attribute returns the total number of elements in the DataFrame, which is just the product of the number of rows and columns. The ndim attribute returns the number of dimensions, which is two for all DataFrames. Pandas defines the built-in len function to return the number of rows.
The methods in step 2 and step 3 aggregate each column down to a single number. Each column name is now the index label in a Series with its aggregated result as the corresponding value.
If you look closely, you will notice that the output from step 3 is missing all the object columns from step 2. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access