Skip to content

ENH: Forward & back fill methods #1651

Closed
@max-sixty

Description

@max-sixty

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions