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

Triangle Instantiation #210

Closed
jbogaardt opened this issue Sep 13, 2021 · 1 comment
Closed

Triangle Instantiation #210

jbogaardt opened this issue Sep 13, 2021 · 1 comment

Comments

@jbogaardt
Copy link
Collaborator

I expect this to instantiate, but it doesn't:

import chainladder as cl
import pandas as pd

cl.Triangle(
    data=pd.DataFrame({
        'Accident Date': ['2020-07-23', '2019-07-23', '2018-07-23', '2016-07-23', '2020-08-23', '2019-09-23', '2018-10-23'],
        'Valuation Date': ['2021-01-01', '2021-01-01', '2021-01-01', '2021-01-01', '2021-01-01', '2021-01-01', '2021-01-01'],
        'Loss': [10000, 10000, 10000, 10000, 0, 0, 0]}),
    origin='Accident Date', development='Valuation Date', columns='Loss'
)
@jbogaardt
Copy link
Collaborator Author

Another one that struggles to initialize.

import pandas as pd
import chainladder as cl
from pandas import Timestamp

df = pd.DataFrame({'Total Payroll': {0: 9560818.0, 1: 13929097.0, 2: 21532204.0, 3: 17983334.0},
 'Eval Date': {0: Timestamp('2021-09-16 00:00:00'),
  1: Timestamp('2021-09-16 00:00:00'),
  2: Timestamp('2021-09-16 00:00:00'),
  3: Timestamp('2021-09-16 00:00:00')},
 'Accident Date': {0: Timestamp('2018-10-21 12:00:00'),
  1: Timestamp('2019-10-22 00:00:00'),
  2: Timestamp('2020-10-21 12:00:00'),
  3: Timestamp('2021-08-27 00:00:00')}})
cl.Triangle(df, origin='Accident Date', development = 'Eval Date', columns='Total Payroll')

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