Pandas DataFrame size Property
Example
Return the number of elements in the DataFrame:
import pandas as pd
df = pd.read_csv('data.csv')
print(df.size)
Try it Yourself »
Definition and Usage
The size
property returns the number of elements in the DataFrame.
The number of elements is the number of rows * the number of columns.
In our example the DataFrame has 169 rows and 4 columns: 169 * 4 = 676
Syntax
dataframe.size
Return Value
An Int, representing the number of elements in the DataFrame.
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.