Pandas Series.shape
Pandas Series.shape property
In this tutorial, we'll go through examples for the Pandas Series.shape property, which returns the shape of the Series data as a tuple.
Examples for Series.shape property
1. Getting the shape of given Pandas Series
In the following program, we take a Series object in series_data, get the shape of this Series object using Series.shape property.
Python Program
import pandas as pd
# Create a Pandas Series
series_data = pd.Series([10, 20, 30, 40, 50])
# Get shape of the Series data
shape = series_data.shape
# Display the result
print(shape)Output
(5,)