I have several Pandas Series objects that look like this:
r = pd.Series({'a': [1,2,3,4]})
s = pd.Series({'b': [2,4,1]})
u = pd.Series({'c': [8,6]})
v = pd.Series({'d': [4,3,1]})
I'd like to convert these Series objects into a data fram with the dictionay keys as column names and the values as columns. My desired output is:
'r' 's' 'u' 'v'
0 1 2 8 4
1 2 4 6 3
2 3 1 Nan 1
3 4 Nan Nan Nan
How can I create a data frame object as depicted above? I'm aware of the .fillna
method, but I could not get this to work with my data. The missing values should be Nan. Thanks for the help.