-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Allow numeric ExtensionDtypes in DataFrame.select_dtypes #38246
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 27 commits
503f9fc
ea1796f
3932391
7cf6e3e
0cb170a
83c84ba
1087ff7
7fe272f
77243fd
eb475a8
9b5db9a
9cbf294
4c1d67a
14fabfc
da6cf68
3801310
9e23d20
13b1531
41fd75e
85d0ae8
4445207
31ef92f
5d9d2c2
5d60908
b8495c3
75ea3a2
e84ecb0
1df34f5
0b5a9ef
ce63fa7
93c7403
ef095b5
7c25c80
9bbd980
57b6126
f0902be
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 |
---|---|---|
|
@@ -3711,12 +3711,15 @@ def extract_unique_dtypes_from_dtypes_set( | |
extracted_dtypes = [ | ||
unique_dtype | ||
for unique_dtype in unique_dtypes | ||
# error: Argument 1 to "tuple" has incompatible type | ||
# "FrozenSet[Union[ExtensionDtype, str, Any, Type[str], | ||
# Type[float], Type[int], Type[complex], Type[bool]]]"; | ||
# expected "Iterable[Union[type, Tuple[Any, ...]]]" | ||
if issubclass( | ||
unique_dtype.type, tuple(dtypes_set) # type: ignore[arg-type] | ||
if ( | ||
issubclass( | ||
unique_dtype.type, tuple(dtypes_set) # type: ignore[arg-type] | ||
) | ||
or ( | ||
np.number in dtypes_set | ||
and hasattr(unique_dtype, "_is_numeric") # is an extensionarray | ||
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. can u check is_extension_array_dtype here instead 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. Done |
||
and unique_dtype._is_numeric | ||
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. use 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. Done |
||
) | ||
) | ||
] | ||
return extracted_dtypes | ||
|
Uh oh!
There was an error while loading. Please reload this page.