pandas get size of dataframe code example Example: .size pandas >>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]}) >>> df.size 4