-
-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
TST: tests for inconsistent indexing with datetimes #20550
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20550 +/- ##
==========================================
+ Coverage 91.84% 91.84% +<.01%
==========================================
Files 153 153
Lines 49499 49505 +6
==========================================
+ Hits 45460 45466 +6
Misses 4039 4039
Continue to review full report at Codecov.
|
pandas/tests/indexing/test_loc.py
Outdated
@@ -427,6 +427,13 @@ def test_loc_setitem_consistency(self): | |||
expected = DataFrame({'date': Series(['string'])}) | |||
tm.assert_frame_equal(df, expected) | |||
|
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 move this to pandas/tests/frame/test_indexing.py
make it a new test. (with _datetime in the name). can you add all of the examples in the original post?
also add as a comment the original issue number |
94eaee8
to
c1dfe56
Compare
Done, happy to contribute! Please, let me know if I must make any additional changes. |
pandas/tests/frame/test_indexing.py
Outdated
'y', | ||
pd.datetime(2013, 1, 1), | ||
pd.datetime(2014, 1, 1)]}) | ||
df = pd.DataFrame(np.zeros((6, 2), dtype=int), columns=['a', 'b']) |
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.
this is failing because you are specify the dtype directly I think, just use
pd.DataFrame(0, columns = list('ab'), index=range(6))
pandas/tests/frame/test_indexing.py
Outdated
df.loc[[2, 3], 'b'] = 'x', 'y' | ||
A = pd.DataFrame([[13, pd.datetime(2013, 1, 1)], | ||
[14, pd.datetime(2014, 1, 1)]]) | ||
df.loc[[4, 5], ['a', 'b']] = A.values |
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 assign with a numpy array that you construct directly
Done! :-) |
thanks @jcontesti |
git diff upstream/master -u -- "*.py" | flake8 --diff