Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

IsDtypeValidation not accepting multiple dtypes for a DataFrame Column #61

@pranshuag9

Description

@pranshuag9

I am trying to input int or float, in parameter dtype of IsDtypeValidation but it doesn't accept multiple types. As a general type, i tried with numbers.Number which is a general class for all numbers but it throws error: "The column column_name has a dtype of int64 which is not a subclass of the required type <class 'numbers.Number'>".

Similar error comes when i have assigned it to np.dtype(float) and values in column are only integer.
Same for np.dtype('d'), np.dtype(np.inexact) n all.

I tried using np.inexact or numbers.Number because i thought np.issubdtype() would accept it as True. Is it so?

How can i take multiple dtypes in a column and validate it to True? like it can be float if value in column is float, it can be integer, if value is integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions