Skip to content

ENH: Keep positional arguments for pivotΒ #51359

@Erotemic

Description

@Erotemic

Feature Type

  • Keeping existing functionality in pandas

Problem Description

I'd like to request the pivot method keep its positional arguments. Currently when you use pivot it warns:

FutureWarning: In a future version of pandas all arguments of DataFrame.pivot will be keyword-only.

I posted a question to the mailing list asking about the rational of deprecating the positional arguments in most methods. I received a reply pointing me to this issue: #41485 that seems to suggest the motivation for this was due to static analysis.

I think this is a good change for most methods, but in the case of pivot, you generally specify all 3, and forcing the user to specify them as keyword arguments is a bit cumbersome. At least I find it to be cumbersome.

Because there are only 3 arguments to begin with in this case, I don't think removing flexibility provides enough additional simplification to justify forcing keyword only arguments here.

Feature Description

Simply remove the FutureWarning from pivot and keep the code as-is.

Alternative Solutions

The alternative solution is to ignore me and remove them anyway. I'd be a little sad, but I'd eventually get over it.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closing CandidateMay be closeable, needs more eyeballsEnhancementNeeds 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