打印Pandas 系列的均值
mean() 熊猫库中的函数可用于查找序列的均值。
算法
Step 1: Define a Pandas series.Step 2: Use the mean() function to calculate the mean.
Step 3: Print the mean.
范例程式码
import pandas as pd输出结果series = pd.Series([10,20,30,40,50])
print("Pandas Series: \n", series)
series_mean = series.mean()
print("Mean of the Pandas series:\n", series_mean)
Pandas Series:0 10
1 20
2 30
3 40
4 50
dtype: int64
Mean of the Pandas series:
30.0
以上是 打印Pandas 系列的均值 的全部内容, 来源链接: utcz.com/z/345880.html