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

REGRESSION: Merging on vectors looks broken #19038

Closed
gfyoung opened this Issue Jan 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@gfyoung
Member

gfyoung commented Jan 2, 2018

Here is the code:

import pandas as pd

df = pd.DataFrame([1, 2, 3], ['2016-01-01', '2017-01-01', '2018-01-01'], columns=['a'])
df.index = pd.to_datetime(df.index)

df.merge(df, on=['a', df.index.year])

This works in v0.19.0, but in v0.22.0 fails with:

KeyError: "Int64Index([2016, 2017, 2018], dtype='int64') not in index"

In v0.19.0, the merge produces a result (not sure if I agree with it though):

  a key_1
0 1 2016
1 2 2017
2 3 2018

@gfyoung gfyoung added this to the 0.23.0 milestone Jan 2, 2018

@gfyoung gfyoung changed the title from BUG: Merging on vectors looks broken to REGRESSION: Merging on vectors looks broken Jan 2, 2018

gfyoung added a commit to forking-repos/pandas that referenced this issue Jan 4, 2018

BUG: Allow merging on Index vectors
This behavior used to work in v0.19.0 and
is consistent with the documentation.

Closes pandas-devgh-19038

gfyoung added a commit to forking-repos/pandas that referenced this issue Jan 5, 2018

BUG: Allow merging on Index vectors
This behavior used to work in v0.19.0 and
is consistent with the documentation.

Closes pandas-devgh-19038

gfyoung added a commit to forking-repos/pandas that referenced this issue Jan 6, 2018

BUG: Allow merging on Index vectors
This behavior used to work in v0.19.0 and
is consistent with the documentation.

Closes pandas-devgh-19038

jreback added a commit that referenced this issue Jan 6, 2018

BUG: Allow merging on Index vectors (#19073)
* BUG: Allow merging on Index vectors

This behavior used to work in v0.19.0 and
is consistent with the documentation.

Closes gh-19038

* ENH: Add is_array_like method

Used for abstracting checks in DataFrame.merge,
but the function itself can be quite useful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment