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

Annual conversion in .grain() not working for pandas<2.0.0 [BUG] #539

Open
cdietrich215 opened this issue Aug 22, 2024 · 1 comment
Open
Assignees
Labels

Comments

@cdietrich215
Copy link

Describe the bug
Getting an error when converting to an annual grain when pandas <2.0.0 using the .grain() method. I believe this was caused by the release of chainladder version 0.8.21

To Reproduce

The following code causes an error when chainladder verion = 0.8.23 and pandas version = 1.5.2

import chainladder as cl
import pandas as pd

tri = cl.load_sample('prism')['Incurred'].sum()
tri.grain('OYDY')
@Evgeny-Avdeev
Copy link

I think mistake is in triangle.py line 693.
Now it looks like:
freq = {"Y": "Y", "S": "2Q"}.get(ograin_new, ograin_new)
But should be as it was before (ver. 0.8.15):
freq = {"Y": "A", "S": "2Q"}.get(ograin_new, ograin_new)

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

No branches or pull requests

3 participants