pandas.Index.mean#

Index.mean(*, axis=None, dtype=None, out=<no_default>, keepdims=False, skipna=True)[source]#

Return the mean of the values in the Index.

NA/null values are excluded by default.

Parameters:
axis{None, 0}

Unused. Parameter needed for compatibility with numpy.

dtype, outNone

Not implemented; kept for compatibility with numpy.mean(), which calls this method. Must be left at the default.

keepdimsbool, default False

Not implemented; must be left at the default.

skipnabool, default True

Exclude NA/null values when computing the result.

Returns:
scalar

The mean of the values.

See also

Index.median

Return the median of the values.

Series.mean

Return the mean of the values of a Series.

Examples

>>> pd.Index([1, 2, 3, 4]).mean()
2.5