Free tools Windows power users keep installed
One-click scans. No signup required.
Use s.to_frame() to turn a pandas Series into a one-column DataFrame while keeping its index as the row index. Use s.reset_index() when the Series index labels should instead become ordinary DataFrame columns. For a MultiIndex Series, choose reset_index() to expose index levels or unstack() to pivot one level into columns.
Choose based on what should happen to the Series index
| Goal | Method | Result |
|---|---|---|
| Keep the current index as the DataFrame row index | s.to_frame() |
One data column; its label defaults to the Series name when available. |
| Set a specific label for the values column | s.to_frame(name="values") |
One data column named values, with the Series index retained. |
| Make index labels into DataFrame columns | s.reset_index() |
Index-level column(s), followed by a column containing Series values. |
| Make index labels into columns and name the values column | s.reset_index(name="values") |
Former index column(s) plus a values column named values. |
| Spread one MultiIndex level across columns | s.unstack() |
A pivoted DataFrame; the resulting layout depends on the levels. |
Keep the Series index with to_frame()
For a straightforward one-column conversion, use the Series to_frame() method:
import pandas as pd
s = pd.Series([10, 20, 30], index=["a", "b", "c"], name="score")
df = s.to_frame()
The resulting DataFrame has one column, named score, and keeps a, b, and c as its row index. The pandas API describes Series.to_frame as converting a Series to a DataFrame and returning a DataFrame representation: pandas Series.to_frame API.
Set or override the column name
Pass name when the Series is unnamed or you want a deliberate output label:
#1 Best Overall
df = s.to_frame(name="values")
This sets the one DataFrame column’s label to values, overriding the Series name if it has one.
Turn index labels into columns with reset_index()
If the index labels are data you need in the result, use reset_index() with its default drop=False behavior:
Rank #2
df = s.reset_index()
The old index becomes a DataFrame column, and another column contains the Series values. If the index is named, that name is used for its column; otherwise pandas supplies a default label. The official API documents the parameters and return behavior: pandas Series.reset_index API.
Name the values column
Use the name argument to label the column containing the Series values:
df = s.reset_index(name="values")
Here, name applies to the values column, not the column created from the old index.
Do not use drop=True when you need a DataFrame
s.reset_index(drop=True) discards the old index without inserting it into the result and returns a Series rather than a DataFrame. Leave drop at its default when you want the old index retained as a column and a DataFrame returned.
Handle a Series with a MultiIndex
A MultiIndex has multiple index levels, so the right operation depends on whether you want those levels as columns or want to reshape the data.
Expose index levels as columns
Call reset_index() to move all MultiIndex levels into columns alongside the values. To reset only selected levels and leave some index structure in place, pass the relevant level or levels with level=.
Best Value
Pivot a level into columns with unstack()
Use s.unstack() when the intended result spreads one MultiIndex level across the DataFrame’s columns, rather than listing every index level as a column. The pandas Series API includes unstack as a way to produce a DataFrame from a Series with a MultiIndex: pandas Series API.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




