casact / chainladder-python

Actuarial reserving in Python
https://chainladder-python.readthedocs.io/en/latest/
Mozilla Public License 2.0
192 stars 71 forks source link

[BUG] origin and development parameters of Triangle class cannot handle lists #538

Open dlembke97 opened 4 months ago

dlembke97 commented 4 months ago

Describe the bug The Triangle class docstring states that origin and development parameters can take str or list inputs, but it does not seem to work with lists

To Reproduce

import pandas as pd
import numpy as np
np.NINF = -np.inf
import chainladder as cl

raa_df = pd.read_csv(
    "https://raw.githubusercontent.com/casact/chainladder-python/master/chainladder/utils/data/raa.csv"
)

raa = cl.Triangle(
    raa_df,
    origin=["development", "origin"],
    development="development",
    columns="values",
    cumulative=True,
)
raa

Expected behavior triangle object with a triangle created for both development year and origin year as development period (In theory would just be a column when development period is used for the origin parameter)

Desktop (please complete the following information):