-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Add is_any_real_numeric_dtype
to solve discrepancy between Index.is_numeric()
and is_numeric_dtype()
#51160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 18 commits
1c56bfb
8fc2bab
a7dc177
9e731bd
1dba6c6
ea39ebf
df70557
f260a83
6f3da1b
6dfd7e5
a329e4c
02bf372
44f91a1
2a3d209
3c8dddf
7cda345
3b5069c
a690f17
c02aded
c9e2758
7cc0b10
4cdc9eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1219,9 +1219,9 @@ def is_numeric_dtype(arr_or_dtype) -> bool: | |
) | ||
|
||
|
||
def is_any_numeric_dtype(arr_or_dtype) -> bool: | ||
def is_any_real_numeric_dtype(arr_or_dtype) -> bool: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @phofl on the off chance someone is actually using this, maybe it's safer if we make an alias There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was only added a couple of days ago, it's especially in no release yet, so I think we are good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah okay gotcha. Fine to change then |
||
""" | ||
Check whether the provided array or dtype is of a real number dtype | ||
Check whether the provided array or dtype is of a real number dtype. | ||
|
||
Parameters | ||
---------- | ||
|
@@ -1231,19 +1231,21 @@ def is_any_numeric_dtype(arr_or_dtype) -> bool: | |
Returns | ||
------- | ||
boolean | ||
Whether or not the array or dtype is of a real number dtype | ||
Whether or not the array or dtype is of a real number dtype. | ||
|
||
Examples | ||
------- | ||
>>> is_any_numeric_dtype(str) | ||
False | ||
>>> is_any_numeric_dtype(int) | ||
-------- | ||
>>> is_any_real_numeric_dtype(int) | ||
True | ||
>>> is_any_numeric_dtype(float) | ||
>>> is_any_real_numeric_dtype(float) | ||
True | ||
>>> is_any_numeric_dtype(complex(1,2)) | ||
>>> is_any_real_numeric_dtype(object) | ||
False | ||
>>> is_any_real_numeric_dtype(str) | ||
False | ||
>>> is_any_real_numeric_dtype(complex(1, 2)) | ||
False | ||
>>> is_any_numeric_dtype(bool) | ||
>>> is_any_real_numeric_dtype(bool) | ||
False | ||
""" | ||
return ( | ||
|
@@ -1808,7 +1810,7 @@ def is_all_strings(value: ArrayLike) -> bool: | |
"is_nested_list_like", | ||
"is_number", | ||
"is_numeric_dtype", | ||
"is_any_numeric_dtype", | ||
"is_any_real_numeric_dtype", | ||
"is_numeric_v_string_like", | ||
"is_object_dtype", | ||
"is_period_dtype", | ||
|
Uh oh!
There was an error while loading. Please reload this page.