pandas.Index.median#

Index.median(*, axis=None, skipna=True, **kwargs)[source]#

Return the median of the values in the Index.

NA/null values are excluded by default.

Parameters:
axis{None, 0}

Unused. Parameter needed for compatibility with numpy.

skipnabool, default True

Exclude NA/null values when computing the result.

**kwargs

Additional keywords for compatibility with numpy.

Returns:
scalar

The median of the values.

See also

Index.mean

Return the mean of the values.

Series.median

Return the median of the values of a Series.

Examples

>>> pd.Index([1, 2, 10]).median()
2.0