I realize Dataframe takes a map of {\'series_name\':Series(data, index)}. However, it automatically sorts that map even if the map is an OrderedDict().
Is there a simpl
Build the list of series:
import pandas as pd
import numpy as np
> series = [pd.Series(np.random.rand(3), name=c) for c in list('abcdefg')]
First method pd.DataFrame.from_items
:
> pd.DataFrame.from_items([(s.name, s) for s in series])
a b c d e f g
0 0.071094 0.077545 0.299540 0.377555 0.751840 0.879995 0.933399
1 0.538251 0.066780 0.415607 0.796059 0.718893 0.679950 0.502138
2 0.096001 0.680868 0.883778 0.210488 0.642578 0.023881 0.250317
Second method pd.concat
:
> pd.concat(series, axis=1)
a b c d e f g
0 0.071094 0.077545 0.299540 0.377555 0.751840 0.879995 0.933399
1 0.538251 0.066780 0.415607 0.796059 0.718893 0.679950 0.502138
2 0.096001 0.680868 0.883778 0.210488 0.642578 0.023881 0.250317