Skip to content

Panel.apply() still uses np.apply_along_axis, discarding the indices and labels #5556

Closed
@aldanor

Description

@aldanor

Panel.apply(func, axis) currently just pulls out .values and passes them to numpy.apply_along_axis -- which makes its utility questionable since all the indices and labels get lost in the process.

Wouldn't it make much more sense to pass DataFrames to the func and then try and recombine the result into either Series, DataFrame or a Panel?

By the way, this behaviour is not in the docs and is inconsistent with how apply works for series/frames, so an unwary user might be in for a surprise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions