Pandas Series.T
Pandas Series.T property
In this tutorial, we'll go through examples for the Pandas Series.T property, which returns the transpose of the Series.
By definition of Pandas Series, the transpose operation on a given Series results in the same original Series.
Examples for Series.T property
1. Getting Transpose of given Pandas Series
In the following program, we take a Series object in series_data, and get the transpose of this Series object using Series.T property.
Python Program
import pandas as pd
# Create a Pandas Series
series_data = pd.Series([10, 20, 30, 40, 50])
# Find transpose
result = series_data.T
# Display the result
print(f"Given series\n{series_data}\n")
print(f"Transpose\n{result}")Output
Given series
0 10
1 20
2 30
3 40
4 50
dtype: int64
Transpose
0 10
1 20
2 30
3 40
4 50
dtype: int64