-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DatetimeIndex comparison with ndim>1 incorrect or raises #19088
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
Comments
This looks correct now @jbrockmendel?
|
I’d prefer if 62 broadcast, but that’s not something we do with any consistency. The rest are clearly much improved. |
I think these all look correct now that we store Timestamp objects in numpy arrays. Could use tests
|
Hey @mroeschke have the tests for this been written? Can I work on it as my first time issue? |
Yes.
Hard to tell. I'd suggest adding a check that intentionally raises in the relevant cases and see if anything in the test suite breaks. |
No problem, As a first step, I have been through creating a development environment successfully and set up pandas so that it is running in a docker devcontainer. Been through the test suite and there is nothing immediate that stands out. Do you suggest having 2 tests, one for series and one for dataframes that cover the relevant scenarios above? |
Looks to be abandon, jumping in to pick this up. |
take |
Seems like last line of my test: def test_date_range_index_comparison(self):
rng = date_range("2011-01-01", periods=3, tz="US/Eastern")
df = Series(rng).to_frame()
arr = np.array([rng.to_list()]).T
arr2 = np.array([rng]).T
with pytest.raises(ValueError):
rng == df
with pytest.raises(ValueError):
df == rng
tm.assert_numpy_array_equal(df.values, arr)
tm.assert_numpy_array_equal(df.values, arr2)
tm.assert_numpy_array_equal(df[0].values, arr2[:, 0]) Results in: E AssertionError: numpy array are different
E
E numpy array values are different (100.0 %)
E [left]: [2011-01-01T05:00:00.000000000, 2011-01-02T05:00:00.000000000, 2011-01-03T05:00:00.000000000]
E [right]: [2011-01-01 00:00:00-05:00, 2011-01-02 00:00:00-05:00, 2011-01-03 00:00:00-05:00]``` |
I think you should be doing
|
Discovered while testing #18162.
The text was updated successfully, but these errors were encountered: