An easy and efficient way to convert the pandas series to pandas data frames is the use of .to_frame()
function.
Example
my_series = pd.Series([10,20,30,40,50]) my_series
Let’s convert it to a pandas data frame.
my_series.to_frame()
Or, if you want to give a column name:
my_series.to_frame(name="xxx")