BUG: MultiIndex.is_montonic erronoes when nan in at least one level · Issue #37220 · pandas-dev/pandas (original) (raw)


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

print(pd.MultiIndex.from_tuples([(np.nan, ), (1,)], names=["test"]).is_monotonic_increasing)

Problem description

This returns True, which is obviously not correct. This was introduced by #27495. The error persists with more than one level in the MultiIndex. The example is just for simplicity.

Expected Output

False

Output of pd.show_versions()

master