You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is some code that is executed early on in the Triangle constructor that handles the situation where the data contain ultimates:
@staticmethod
def _split_ult(
data: DataFrame,
index: list,
columns: list,
origin: list,
development: list
):
"""Deal with triangles with ultimate values"""
ult = None
if (
development
and len(development) == 1
and data[development[0]].dtype == "<M8[ns]"
):
u = data[data[development[0]] == options.ULT_VAL].copy()
if len(u) > 0 and len(u) != len(data):
ult = Triangle(
u,
origin=origin,
development=development,
columns=columns,
index=index,
)
ult.ddims = pd.DatetimeIndex([options.ULT_VAL])
data = data[data[development[0]] != options.ULT_VAL]
return data, ult
Is there a sample or anywhere in the documentation where we supply data with ultimates? From the code it's unclear to me how one would do explicitly, since the way ultimate values are detected depend on the the length of a list and the data type of the values, <M8[ns], which is obscure to me, rather than some explicit flag named "ultimate" or something resembling it.
It seems to me this was written to handle triangles that have already been developed via chainladder rather than as a way to allow the user a way to import ultimate data from the beginning. If it's the former case we can add enhance the docstring, but if the latter perhaps we could add an argument to the triangle constructor explicitly marking the existence of ultimate values.
The text was updated successfully, but these errors were encountered:
I think this was added in the spirit of allowing any triangle that is exported to_frame to be reconstructed back into the same triangle using the constructor.
There is some code that is executed early on in the Triangle constructor that handles the situation where the data contain ultimates:
Is there a sample or anywhere in the documentation where we supply data with ultimates? From the code it's unclear to me how one would do explicitly, since the way ultimate values are detected depend on the the length of a list and the data type of the values,
<M8[ns]
, which is obscure to me, rather than some explicit flag named "ultimate" or something resembling it.It seems to me this was written to handle triangles that have already been developed via chainladder rather than as a way to allow the user a way to import ultimate data from the beginning. If it's the former case we can add enhance the docstring, but if the latter perhaps we could add an argument to the triangle constructor explicitly marking the existence of ultimate values.
The text was updated successfully, but these errors were encountered: