Skip to content

dtype hierarchy / is_dtype #188

Closed
Closed
@MarcoGorelli

Description

@MarcoGorelli

Splitting this out from here: #187 (comment)

I'd like to have a way for users to write something like

if ser.dtype.kind in "if"

without having to do

if isinstance(
    column.dtype,
    (
        namespace.Int64,
        namespace.Int32,
        namespace.Int16,
        ...,
        namespace.Float32,
    )
) 

I think it's pretty important to be able to check whether a column is of integer dtype, without to check through all the classes

How do we want to do this? Do we want something like https://data-apis.org/array-api/latest/API_specification/generated/array_api.isdtype.html#array_api.isdtype , so users can do is_dtype(column.dtype, 'integral')?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions