Skip to main content
`Ctrl`+`K`

# pandas.Series.to_frame

Series.to_frame(name=<no_default>)

  Convert Series to DataFrame.

  The resulting DataFrame contains a single column. The name of the column can be set using the `name` parameter; otherwise it defaults to the Series’ name.

  Parameters:
    name object, optional

      The passed name should substitute for the series name (if it has one).

  Returns:
    DataFrame

      DataFrame representation of Series.

  See also

  `Series.to_dict`

    Convert Series to dict object.

  Examples

      >>> s = pd.Series(["a", "b", "c"], name="vals")
      >>> s.to_frame()
        vals
      0    a
      1    b
      2    c