-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
API: ExtensionDtype._is_numeric #22345
Changes from all commits
5064217
50de326
1d96d22
db9af36
a3fdc2a
fc34131
2779419
e813855
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 |
---|---|---|
|
@@ -67,3 +67,7 @@ def test_no_values_attribute(self, data): | |
# code, disallowing this for now until solved | ||
assert not hasattr(data, 'values') | ||
assert not hasattr(data, '_values') | ||
|
||
def test_is_numeric_honored(self, data): | ||
result = pd.Series(data) | ||
assert result._data.blocks[0].is_numeric is data.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. Maybe you can also test It would be nice if this would also work for 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, that is done below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this test pass? (I thought reductions did not yet work for EAs?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's going through the fallback
np.mean(arr)
? Will investigate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so reductions for Series fail (no
_reduce
), but for dataframe it seems to use some ndarray fallback