>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}) >>> df.shape (2, 2)
Here is what the above code is Doing:
1. We create a DataFrame from a dictionary.
2. We call the shape method on the DataFrame.
The shape method returns a tuple of the form (rows, columns).