Skip to content

ENH: Utility to return "feasible" dtype for infer_dtype output. #61256

Open
@mroeschke

Description

@mroeschke

pandas.api.types.infer_dtype returns a string label of the inferred type of data. (While these should probably be an enum), these string labels do not map cleanly to what supported pandas data type represents that data e.g "mixed" would probably map to "object"

It would be nice to

  1. Add a parameter as_pandas_type: bool = False that would return an enum representing the supported pandas type (e.g. "mixed" and "unknown-array", maps to "PandasType.OBJECT")
  2. Add a separate function to do this

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNeeds 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