-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
BUG: Left join on index and column gives incorrect output #28243
Comments
@dsaxton I would expect the same output as you described. But the function I found a few tests covering exactly this behavior.
instead of
I think that I have found a fix for the index issue, but the value issue is unrelated. |
@phofl Yeah I think I recall the _maybe_add_join_keys function and not really understanding why it was needed |
@dsaxton Thanks very much. I will push a PR shortly, but I think we have to talk about the expected behavior, because that is not 100 percent clear to me. I will look into |
Problem description
This is closely related to #28220 but deals with the values of the
DataFrame
rather than the index itself. When left joining on an index and a column it looks like the value"b"
from the index ofdf_left
is somehow getting carried over to the columnx
, but"a"
should be the only value in this column since it's the only one that matches the index fromdf_left
. This is happening on 0.25.1 and master, and has been a bug for some time according to #28220.Expected Output
Output of
pd.show_versions()
pandas : 0.25.1
numpy : 1.16.4
pytz : 2019.2
dateutil : 2.8.0
pip : 19.1.1
setuptools : 41.0.1
Cython : None
pytest : 5.0.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : 7.7.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
Seems related to this issue: #17257
The text was updated successfully, but these errors were encountered: