chainladder.load_sample

Contents

chainladder.load_sample#

chainladder.load_sample(key: str, *args, **kwargs) Triangle[source]#

Function to load a dataset already included in the chainladder package. These consist of CSV files located in the repository directory chainladder/utils/data.

Parameters:
key: str (not case sensitive)

The name of the dataset. The name should match the file name, without extension, of one of the files in the sample data folder.

Datasets that are commonly used in examples are: raa, clrd, and prism.

For the complete list of available datasets, call list_samples().

Returns:
chainladder.Triangle of the loaded dataset.

Examples

Loading “raa” as an example.

tr = cl.load_sample("raa")
print(tr)
         12       24       36       48       60       72       84       96       108      120
1981  5012.0   8269.0  10907.0  11805.0  13539.0  16181.0  18009.0  18608.0  18662.0  18834.0
1982   106.0   4285.0   5396.0  10666.0  13782.0  15599.0  15496.0  16169.0  16704.0      NaN
1983  3410.0   8992.0  13873.0  16141.0  18735.0  22214.0  22863.0  23466.0      NaN      NaN
1984  5655.0  11555.0  15766.0  21266.0  23425.0  26083.0  27067.0      NaN      NaN      NaN
1985  1092.0   9565.0  15836.0  22169.0  25955.0  26180.0      NaN      NaN      NaN      NaN
1986  1513.0   6445.0  11702.0  12935.0  15852.0      NaN      NaN      NaN      NaN      NaN
1987   557.0   4020.0  10946.0  12314.0      NaN      NaN      NaN      NaN      NaN      NaN
1988  1351.0   6947.0  13112.0      NaN      NaN      NaN      NaN      NaN      NaN      NaN
1989  3133.0   5395.0      NaN      NaN      NaN      NaN      NaN      NaN      NaN      NaN
1990  2063.0      NaN      NaN      NaN      NaN      NaN      NaN      NaN      NaN      NaN