Skip to content
Discussion options

You must be logged in to vote

Your dates format are a bit unusual so I wonder if python is confused. I would recommend explicitly specifying the date format first.

df = pd.read_csv("/Users/kennethhsu/Desktop/test.csv")
df["OriginDate"] = pd.to_datetime(df["OriginDate"], format="%d/%m/%y")
df["Develop"] = pd.to_datetime(df["Develop"], format="%d/%m/%y")

Next, the valuation date should be the end of the month. So do this:

df["Valuation"] = df["Develop"] - pd.Timedelta(days=1)
df

Now you are ready to go into chainladder:

triangle = cl.Triangle(
    df,
    origin="OriginDate",
    development="Valuation",
    columns="Value",
    cumulative=True,
    grain="OYDQ"
)
triangle

Can you try the above and see if it works for you?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Coomaren
Comment options

Answer selected by Coomaren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants