Skip to content

ENH: Deprecate DataFrame.iterrows #43874

Open
@dclong

Description

@dclong

Is your feature request related to a problem?

  1. DataFrame.iterrows does not preserve types. There are lots of users reporting issues related to this. Even though the behavior is documented, why do we want to have a method that get used a lot but keep surprising users? I bet most users won't read the doc thoroughly until they get bitten by the issue.
  2. DataFrame.iterrows is much slower than other ways of iterating over rows of a DataFrame anyway.

Describe the solution you'd like

Deprecate DataFrame.iterrows.

API breaking implications

[this should provide a description of how this feature will affect the API]
DataFrame.iterrows will be deprecated in future.

Describe alternatives you've considered

Maybe rename iterrows to a better name as suggested in the issue #43245?

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    DataFrameDataFrame data structureDeprecateFunctionality to remove in pandasNeeds DiscussionRequires discussion from core team before further action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions