In this python pandas program,we will find the mean of the data of a given series using pandas library.
Steps to solve the program
- Import pandas library as pd.
- Create a series using pd.Series().
- Find the mean of the given series using df.mean().
- Print the output.
import pandas as pd
df = pf.Series([5,4,8,6])
print(df)
print("Mean of the given series: ",df.mean())
Output :
0 5
1 4
2 8
3 6
dtype: int64
Mean of the given series: 5.75