We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4d246f commit 29a9e5dCopy full SHA for 29a9e5d
doc/source/user_guide/merging.rst
@@ -735,13 +735,15 @@ using :meth:`Series.reset_index`.
735
736
# The series has a multi-index with levels corresponding to columns in
737
# the DataFrame we want to merge with
738
- ser = pd.Series(['a', 'b', 'c', 'd', 'e', 'f'],
739
- index=pd.MultiIndex.from_arrays([["A", "B", "C"] * 2,
740
- [1, 2, 3, 4, 5, 6]], names=['Let', 'Num']))
+ ser = pd.Series(
+ ['a', 'b', 'c', 'd', 'e', 'f'],
+ index=pd.MultiIndex.from_arrays([["A", "B", "C"] * 2,
741
+ [1, 2, 3, 4, 5, 6]], names=['Let', 'Num'])
742
+ )
743
ser
744
745
# Convert the Series to a DataFrame and merge
- pd.merge(df, ser.reset_index(), on=['Let', 'Num'])
746
+ df2 = pd.merge(df, ser.reset_index(), on=['Let', 'Num'])
747
type(df2)
748
749
# Now we merge the DataFrames
0 commit comments