Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame([[3.0, 2.0],
                   [4.0, np.nan],
                   [2.0, 0.0]],
                   columns=list('XY'))
df
Out[2]:
X Y
0 3.0 2.0
1 4.0 NaN
2 2.0 0.0

By default, iterates over rows and finds the minimum in each column:

In [3]:
df.cummin()
Out[3]:
X Y
0 3.0 2.0
1 3.0 NaN
2 2.0 0.0

To iterate over columns and find the minimum in each row, use axis=1

In [4]:
df.cummin(axis=1)
Out[4]:
X Y
0 3.0 2.0
1 4.0 NaN
2 2.0 0.0