Skip to content

BUG: pd.api.types.is_signed_integer_dtype(np.floating) throws TypeError #62018

@windiana42

Description

@windiana42

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import numpy as np

print(pd.__version__)
print(np.__version__)
pd.api.types.is_signed_integer_dtype(np.floating)

Issue Description

for
pandas version 2.3.1
and numpy version 2.3.2,
The code above throws exception:

Traceback (most recent call last):
File "scratch_40.py", line 6, in
pd.api.types.is_signed_integer_dtype(np.floating)
File ".pixi/envs/default/lib/python3.12/site-packages/pandas/core/dtypes/common.py", line 744, in is_signed_integer_dtype
return _is_dtype_type(
^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/pandas/core/dtypes/common.py", line 1467, in _is_dtype_type
return condition(np.dtype(arr_or_dtype).type)
^^^^^^^^^^^^^^^^^^^^^^
TypeError: Converting np.inexact or np.floating to a dtype not allowed

Expected Behavior

pd.api.types.is_signed_integer_dtype(np.floating) == False

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions