Skip to content

DOC: Add example for multiindex series and dataframe merge #32068

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
linting
  • Loading branch information
ryankarlos committed Feb 27, 2020
commit a16d814ca785cb2c332519fcbd87362ee110aa62
10 changes: 5 additions & 5 deletions doc/source/user_guide/merging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,11 @@ using :meth:`Series.reset_index`.
df = pd.DataFrame({"Let": ["A", "B", "C"], "Num": [1, 2, 3]})
df

# The series has a multi-index with levels corresponding to columns in the DataFrame we want to merge with
ser = pd.Series(
['a', 'b', 'c', 'd', 'e', 'f'],
index=pd.MultiIndex.from_arrays([["A", "B", "C"] * 2, [1, 2, 3, 4, 5, 6]], names=['Let', 'Num']
)
# The series has a multi-index with levels corresponding to columns in
# the DataFrame we want to merge with
ser = pd.Series(['a', 'b', 'c', 'd', 'e', 'f'],
index=pd.MultiIndex.from_arrays([["A", "B", "C"] * 2,
[1, 2, 3, 4, 5, 6]], names=['Let', 'Num']))
ser

# Convert the Series to a DataFrame and merge
Expand Down