-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Support hard-masked numpy arrays #24581
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
Conversation
Hello @karldw! Thanks for updating the PR.
Comment last updated on January 03, 2019 at 15:45 Hours UTC |
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.
whatsnew looks fine
@@ -757,6 +757,20 @@ def test_constructor_maskedarray_nonfloat(self): | |||
assert frame['A'][1] is True | |||
assert frame['C'][2] is False | |||
|
|||
# Check hardened masks |
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.
can you make a new tests & add the issue number as a comment
@@ -757,6 +757,20 @@ def test_constructor_maskedarray_nonfloat(self): | |||
assert frame['A'][1] is True | |||
assert frame['C'][2] is False | |||
|
|||
# Check hardened masks | |||
mat_hard = ma.masked_all((2, 3), dtype=float).harden_mask() | |||
frame = DataFrame(mat_hard, columns=['A', 'B', 'C'], index=[1, 2]) |
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.
use the format
result =
expected = pd.DataFrame(....)
tm.assert_frame_equal(result, expected)
construct the expected exactly
@@ -386,6 +386,11 @@ def test_constructor_maskedarray(self): | |||
expected = Series([nan, nan, nan]) | |||
assert_series_equal(result, expected) | |||
|
|||
data_hard = ma.copy(data).harden_mask() |
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.
add a separate test
Codecov Report
@@ Coverage Diff @@
## master #24581 +/- ##
==========================================
+ Coverage 92.36% 92.36% +<.01%
==========================================
Files 166 166
Lines 52494 52496 +2
==========================================
+ Hits 48485 48487 +2
Misses 4009 4009
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24581 +/- ##
==========================================
+ Coverage 92.36% 92.38% +0.02%
==========================================
Files 166 166
Lines 52494 52490 -4
==========================================
+ Hits 48485 48493 +8
+ Misses 4009 3997 -12
Continue to review full report at Codecov.
|
https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=6404 some lint issues as well |
lgtm. ping on green. |
some lint issues |
thanks @karldw |
Thank you! |
git diff upstream/master -u -- "*.py" | flake8 --diff
For the whatsnew entry, is this reasonable?