You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/pandas/core/reshape/merge.py", line 88, in merge
return op.get_result()
File "/usr/lib/python3.8/site-packages/pandas/core/reshape/merge.py", line 668, in get_result
self._maybe_add_join_keys(result, left_indexer, right_indexer)
File "/usr/lib/python3.8/site-packages/pandas/core/reshape/merge.py", line 824, in _maybe_add_join_keys
key_col.name = name
AttributeError: 'numpy.ndarray' object has no attribute 'name'
Thing is, it works fine if I change i in the left DataFrame from [2] to [1]. It only fails if there's no overlap between the join keys.
This behavior is problematic because the failure depends on the outcome of the merge, so it's difficult to avoid.
Expected Output
I expect this to not fail and just return an empty result.
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
This merge fails with the following error:
Thing is, it works fine if I change
i
in the left DataFrame from[2]
to[1]
. It only fails if there's no overlap between the join keys.This behavior is problematic because the failure depends on the outcome of the merge, so it's difficult to avoid.
Expected Output
I expect this to not fail and just return an empty result.
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: