Run
import pandas as pd import numpy as np # Initialize a DataFrame df = pd.DataFrame( [[21, 72, 67.1], [23, 78, 69.5], [32, 74, 56.6], [52, 54, 76.2]], columns=['a', 'b', 'c']) print('The DataFrame is :\n', df) # Get DataFrame shape shape = df.shape print('\nDataFrame Shape :', shape) print('\nNumber of rows :', shape[0]) print('\nNumber of columns :', shape[1])
Output