BUG: MultiIndex.is_montonic erronoes when nan in at least one level · Issue #37220 · pandas-dev/pandas (original) (raw)
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of pandas.
- (optional) I have confirmed this bug exists on the master branch of pandas.
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