Skip to content

DEPR: NDFrame.align broadcast_axis, fill_axis keywords #51856

Closed
@jbrockmendel

Description

@jbrockmendel

broadcast_axis is only used internally in one places in NDFrame._where, and is ignored unless broadcast_axis == 1 and self.ndim != other.ndim. It also looks like the code path in which it is used is going to be buggy if there are non-unique columns. I doubt any users are using this. Let's deprecate it.

fill_axis has no non-test usages. It looks like it, along with method and limit, are used to do a fillna after the actual alignment.

We are also inconsistenet in what we do with fill_value. In _align_frame we pass fill_value to _reindex_with_indexers and dont pass it to that follow-up fillna. In align_series we do not pass it to reindex_indexer but do pass it to the follow-up fillna. My guess is that we could consistent pass it during the reindex step. Assuming that is the case, we should deprecate the fillna step and associated kwargs and tell users to do the fillna explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDeprecateFunctionality to remove in pandasNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions