-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Are you on the latest chainladder version?
- Yes, this bug occurs on the latest version.
Describe the bug in words
Renaming the columns of the triangle fails to update the attribute Triangle.columns_label. I would suspect the same issue would happen to Triangle.origin_label.
I would also think the reverse issue would happen, where attributes Triangle.columns_label and Triangle.origin_label are re-assigned, but with those changes failing to cascade to the origin and columns indexes.
I think the columns_label case is easier to fix than the origin_label case. We can make Triangle.columns_label a property, which can read the column names from the corresponding index.
origin_label is trickier though, since it seems like that information is lost when creating the origin axis unless stored elsewhere.
How can the bug be reproduced?
import chainladder as cl
genins = cl.load_sample('genins')
genins.rename('columns', 'foo')
print(genins.columns.values)
print(genins.columns_label)print(genins.columns.values) will output ['bar'] whereas print(genins.columns_label) will output ['values'].
What is the expected behavior?
print(genins.columns_label) should output ['bar'].