-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: dropna() on single column timezone-aware values (#13407) #20422
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
Codecov Report
@@ Coverage Diff @@
## master #20422 +/- ##
==========================================
- Coverage 91.85% 91.82% -0.03%
==========================================
Files 152 152
Lines 49231 49232 +1
==========================================
- Hits 45220 45209 -11
- Misses 4011 4023 +12
Continue to review full report at Codecov.
|
Hello @JQGoh! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on March 25, 2018 at 14:23 Hours UTC |
5445316
to
4fee776
Compare
@TomAugspurger In case this could be of your interest. I recall that my first commit passed all the CI tests. However, the current failure is related to the new change in pandas/tests/extension/json/test_json.py |
Sorry about that. Fixed on master. If you fetch master and merge it into your branch things should pass. You can also fixup that pep8 issue. |
@TomAugspurger Thank you for the revisions. I have fixed the PEP8 issues as well, please help to review the changes if possible. |
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.
lgtm. some tests comments. ping on green.
pandas/tests/frame/test_missing.py
Outdated
@@ -183,6 +186,27 @@ def test_dropna_multiple_axes(self): | |||
inp.dropna(how='all', axis=(0, 1), inplace=True) | |||
assert_frame_equal(inp, expected) | |||
|
|||
def test_dropna_tz_aware_datetime(self): | |||
# GH13407 | |||
# Example reported by GH13407 |
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 remove this second coment
pandas/tests/frame/test_missing.py
Outdated
assert_frame_equal(result, expected) | ||
|
||
# Ex2 | ||
df2 = DataFrame({'Time': [dt1, None, np.nan, dt2]}) |
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.
name this df, and use result and expected here
@jreback Thank you for your suggestions. Done. |
thanks for the patch @JQGoh nice to have an older issue closed! |
git diff upstream/master -u -- "*.py" | flake8 --diff
As mentioned by the title of #13407, DataFrame.values not a 2D-array when constructed from timezone-aware datetimes. Hence,
notna(frame.values)
raisesValueErorr: 'axis' entry is out of bounds
because user tries to applydropna
on a 1D-array.I mainly include the example mentioned by the original author of #13407. Let me know if further test examples are required for this issue. Thanks.
Edit: I add additional test example to demonstrate the dropping of np.nan and None from the Series having timezone-ware datetimes.