I have a pandas series of series, like so:
series_list = [pd.Series([1,2], index = ['A', 'B']), pd.Series([3,4], index = ['A', 'B'])]
data = pd.Series(series_list, index = ['i', 'ii'])
I would like to turn this data into a dataframe, using one index as the dataframe's column index, the other as the row index:
pd.DataFrame({'A': [1,3], 'B': [2,4]}, index = ['i', 'ii'])
What is the best way to do this?
Strict approach works fine:
pd.DataFrame(series_list,index = ['i', 'ii'])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With