You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pct_chg is in the df_passthru list in chainladder/core/pandas.py, so Triangle.pct_chg is created as a call to pd.DataFrame.pct_chg. pandas has no such method; the pandas method is pct_change. Every call fails at runtime. The user guide (docs/user_guide/triangle.ipynb) also lists pct_chg as a supported pass-through.
How can the bug be reproduced?
importchainladderasclraa=cl.load_sample("raa")
raa.pct_chg()
# AttributeError: type object 'DataFrame' has no attribute 'pct_chg'. Did you mean: 'pct_change'?
What is the expected behavior?
Triangle.pct_change() should work and match pandas.DataFrame.pct_change on to_frame(). To stay backward compatible, pct_chg could either be kept as a deprecated alias or removed. The user guide table should be updated to match.
Activity