I have a Pandas series sf:
email email1@email.com [1.0, 0.0, 0.0] email2@email.com [2.0, 0.0, 0.0] email3@email.com [1.0, 0.0, 0.0] email4@email.com
Series.to_frame can be used to convert a Series to DataFrame.
Series
DataFrame
# The provided name (columnName) will substitute the series name df = series.to_frame('columnName')
For example,
s = pd.Series(["a", "b", "c"], name="vals") df = s.to_frame('newCol') print(df) newCol 0 a 1 b 2 c