Skip to content

Have convert_dtypes() function for dataframes #23180

@leoliu0

Description

@leoliu0

Description

It will be great to have pandas' df.convert_dtypes() that cast columns to the best possible dtypes.

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.convert_dtypes.html

This will convert, for example, all float columns that are actually integers like [1.0, 2.0, 3.0] to [1, 2, 3].

This could be a option in shrink_to_fit()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or an improvement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions