Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Minimum of ordered categorical data in Panda DataFrames #25299
I have a Pandas DataFrame with one Serie containing ordered Categorical data. Some value of this Serie may be missing (NaN). I want to get the minimum without taking into account NaNs but I obtained strange results ...
raw_cat = pd.Categorical(["a", "b", "c", "a"], categories=["b", "c", "d"], ordered=True) s = pd.Series(raw_cat) raw_cat.min(numeric_only=True), s.min(numeric_only=True)
I am getting the desired output when running this code with pandas 0.23.4 but not with pandas 0.24.0 and above.
Is this an issue or a misunderstanding? Thank you for your help.
So I agree that
Short term, I think it would be good to "just" fix it using