Python Practice › Pandas Programs › Program 18

Mean of a Series

EasyPandas Programs · 18 of 95

Write a pandas program to find the mean of a Series.

Advertisement
Input
[5, 4, 8, 6]
Output
5.75

Approach

  1. mean().

Solution

Python
import pandas as pdprint(pd.Series([5, 4, 8, 6]).mean())
Output
5.75
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More pandas programs

← All 95 Pandas Programs