Description
Pandas DataFrame.bfill() can be mirrored to fill in NaNs in a backward direction along the specified axis.
Leaving this as a proposed "Great First Contribution" as this would be easier than the proposed interpolation/extrapolation feature.
Is your feature request aligned with the scope of the package?
Describe the solution you'd like, or your current workaround.
tri = cl.Triangle(
data={
'origin': [1985, 1985, 1985, 1985, 1986, 1986, 1986, 1987, 1987, 1988],
'development': [1985, 1986, 1987, 1988, 1986, 1987, 1988, 1987, 1988, 1988],
'paid': [np.nan, 600, np.nan, 800, np.nan, 1000, 1100, 1200, 1300, 1400]
},
origin='origin',
development='development',
columns=['paid'],
cumulative=True
)
tri
12 24 36 48
1985 NaN 600.0 NaN 800.0
1986 NaN 1000.0 1100.0 NaN
1987 1200.0 1300.0 NaN NaN
1988 1400.0 NaN NaN NaN
tri.bfill(axis=3)
12 24 36 48
1985 600.0 600.0 800.0 800.0
1986 1000.0 1000.0 1100.0 NaN
1987 1200.0 1300.0 NaN NaN
1988 1400.0 NaN NaN NaN
tri.bfill(axis=4)
12 24 36 48
1985 1200.0 600.0 1100.0 800.0
1986 1200.0 1000.0 1100.0 NaN
1987 1200.0 1300.0 NaN NaN
1988 1400.0 NaN NaN NaN
Do you have any additional supporting notes?
No response
Would you be willing to contribute this ticket?
Description
Pandas DataFrame.bfill() can be mirrored to fill in NaNs in a backward direction along the specified axis.
Leaving this as a proposed "Great First Contribution" as this would be easier than the proposed interpolation/extrapolation feature.
Is your feature request aligned with the scope of the package?
Describe the solution you'd like, or your current workaround.
Do you have any additional supporting notes?
No response
Would you be willing to contribute this ticket?