Closed
Description
I think with np.flip
and bn.push
, this should be simple. They're both fairly new and so would require version checks / upgrading the minimums.
One small issue, I wonder if anyone has come across this: bottleneck
returns the numpy array rather than the DataArray - is that because it's not operating with the correct numpy interface?
Forward fill:
array.values = bn.push(array.values, axis=array.get_axis_num(axis_name))
Backfill:
axis = array.get_axis_num(axis_name)
# reverse for bfill
array = np.flip(array, axis=axis)
# fill
array.values = bn.push(array.values, axis=axis)
# reverse back to original
result = np.flip(scaling, axis=date_axis)