Pandas 3.0 removed the axis argument from DataFrame.groupby() the maintainers want you to use transpose instead:
https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html#other-removals
pandas-dev/pandas#51203
This leads to this test failing:
|
def test_groupby_axis1(clrd, prism): |
|
clrd = clrd.sum("origin").sum("development") |
|
groups = [i.find("Loss") >= 0 for i in clrd.columns] |
|
assert np.all( |
|
clrd.to_frame(origin_as_datetime=False).groupby(groups, axis=1).sum() |
|
== clrd.groupby(groups, axis=1).sum().to_frame(origin_as_datetime=False) |
|
) |
|
assert np.all( |
|
clrd.to_frame(origin_as_datetime=False).groupby("LOB").sum() |
|
== clrd.groupby("LOB").sum().to_frame(origin_as_datetime=False) |
|
) |
|
prism.sum().grain("OYDY") |
Unfortunately, I think we'll need to do a bit of rewriting for groupby. The test still seems to be testing a real-life use case, so instead of testing axis=1, it'll test the transpose functionality of the Triangle.
Pandas 3.0 removed the
axisargument fromDataFrame.groupby()the maintainers want you to use transpose instead:https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html#other-removals
pandas-dev/pandas#51203
This leads to this test failing:
chainladder-python/chainladder/core/tests/test_triangle.py
Lines 316 to 327 in 6ea3577
Unfortunately, I think we'll need to do a bit of rewriting for groupby. The test still seems to be testing a real-life use case, so instead of testing
axis=1, it'll test the transpose functionality of the Triangle.