Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot.box - deprecated pandas function call #775

Open
l-welder opened this issue Aug 24, 2023 · 0 comments
Open

plot.box - deprecated pandas function call #775

l-welder opened this issue Aug 24, 2023 · 0 comments

Comments

@l-welder
Copy link
Collaborator

In the box plot function, panda's set_categories function is called:

df[by].cat.set_categories(list(palette), inplace=True)

However, the inplace parameter of the set_categories was removed in pandas >= 2.0 (see pandas_<2, pandas_>=2).

This leads to an issue when calling the box plot function with a by parameter when the following if call triggers:

if "palette" not in kwargs and "color" in rc and by in rc["color"]:

A simple fix is to replace the line with: df[by].cat = df[by].cat.set_categories(list(palette)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant