Closed
Description
Code Sample, a copy-pastable example if possible
s = pd.Series([10, 9, 11], index=['a', 'b', 'c'], name='w')
df = pd.DataFrame([[3, 4, 5], [6, 7, 8], ['b', 'a', 'c']], index=['x', 'y', 'z'], columns=['p', 'q', 'r']).transpose()
df.merge(s, how='left', left_on='z', right_index=True) # fails
df.merge(s.to_frame(), how='left', left_on='z', right_index=True) # succeeds
We can all keep using .to_frame(), but I feel like the desired behavior of merging a dataframe with a series is well defined.
Food for thought...
Metadata
Metadata
Assignees
Labels
No labels