You can get the dimensions of a pandas DataFrame by calling the shape attribute. Here's an example:
main.py148 chars8 lines
The shape
attribute returns a tuple with two elements, the first element is the number of rows and the second element is the number of columns. In this example, the DataFrame has 3 rows and 2 columns, so the shape attribute returns (3, 2)
.
gistlibby LogSnag