-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Convert to compatible NumPy dtype for MaskedArray to_numpy #55058
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 all commits
c3c718c
03ff78e
2e1a696
92a509f
d55e41f
a37564a
e4618bb
72cfba1
6223938
207a0d0
8a57091
cb7ca91
5c8707a
76e86f2
90bcbe2
b39c729
26f8b38
6dde692
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 |
---|---|---|
|
@@ -169,6 +169,16 @@ def data_for_grouping(dtype): | |
|
||
|
||
class TestMaskedArrays(base.ExtensionTests): | ||
@pytest.mark.parametrize("na_action", [None, "ignore"]) | ||
def test_map(self, data_missing, na_action): | ||
result = data_missing.map(lambda x: x, na_action=na_action) | ||
if data_missing.dtype == Float32Dtype(): | ||
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. If there a solution to avoid this? 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. Not with roundtripping through object, maybe your other suggestion above solves this. No if your suggestion doesn't work |
||
# map roundtrips through objects, which converts to float64 | ||
expected = data_missing.to_numpy(dtype="float64", na_value=np.nan) | ||
else: | ||
expected = data_missing.to_numpy() | ||
tm.assert_numpy_array_equal(result, expected) | ||
|
||
def _get_expected_exception(self, op_name, obj, other): | ||
try: | ||
dtype = tm.get_dtype(obj) | ||
|
Uh oh!
There was an error while loading. Please reload this page.