Open l-welder opened 10 months ago
In the box plot function, panda's set_categories function is called:
panda
set_categories
https://github.com/IAMconsortium/pyam/blob/525ede9a3310198bd497f04041d4a13149adad43/pyam/plotting.py#L714
However, the inplace parameter of the set_categories was removed in pandas >= 2.0 (see pandas_<2, pandas_>=2).
inplace
pandas >= 2.0
This leads to an issue when calling the box plot function with a by parameter when the following if call triggers:
by
https://github.com/IAMconsortium/pyam/blob/525ede9a3310198bd497f04041d4a13149adad43/pyam/plotting.py#L710
A simple fix is to replace the line with: df[by].cat = df[by].cat.set_categories(list(palette)).
df[by].cat = df[by].cat.set_categories(list(palette))
In the box plot function,
panda
'sset_categories
function is called:https://github.com/IAMconsortium/pyam/blob/525ede9a3310198bd497f04041d4a13149adad43/pyam/plotting.py#L714
However, the
inplace
parameter of theset_categories
was removed inpandas >= 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:https://github.com/IAMconsortium/pyam/blob/525ede9a3310198bd497f04041d4a13149adad43/pyam/plotting.py#L710
A simple fix is to replace the line with:
df[by].cat = df[by].cat.set_categories(list(palette))
.