Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
idx = pd.MultiIndex.from_arrays([
    ['warm', 'warm', 'cold', 'cold'],
    ['fox', 'lion', 'snake', 'spider']],
    names=['blooded', 'animal'])
In [3]:
s = pd.Series([4, 4, 0, 8], name='legs', index=idx)
s
Out[3]:
blooded  animal
warm     fox       4
         lion      4
cold     snake     0
         spider    8
Name: legs, dtype: int64

In [4]:
s.max()
Out[4]:
8

Max using level names, as well as indices.

In [5]:
s.max(level='blooded')
Out[5]:
blooded
warm    4
cold    8
Name: legs, dtype: int64
In [6]:
s.max(level=0)
Out[6]:
blooded
warm    4
cold    8
Name: legs, dtype: int64