Skip to content

Commit

Permalink
Prioritize numeric dtypes in is_numerical_dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Mar 22, 2021
1 parent f2e4609 commit 72598fb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions python/cudf/cudf/utils/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,16 @@ def numeric_normalize_types(*args):


def is_numerical_dtype(obj):
if is_categorical_dtype(obj):
return False
if is_list_dtype(obj):
if np.issubdtype(obj, np.bool_):
return True
elif np.issubdtype(obj, np.floating):
return True
elif np.issubdtype(obj, np.signedinteger):
return True
elif np.issubdtype(obj, np.unsignedinteger):
return True
else:
return False
return (
np.issubdtype(obj, np.bool_)
or np.issubdtype(obj, np.floating)
or np.issubdtype(obj, np.signedinteger)
or np.issubdtype(obj, np.unsignedinteger)
)


def is_string_dtype(obj):
Expand Down

0 comments on commit 72598fb

Please sign in to comment.