Suppose I have the example TimeSeries below:
ts = pandas.TimeSeries({'a':[1,2,3,4,5], 'b':[6,7,8,9,10]})
The best method that I could think of for converting this to a 5-column DataFrame is as follows:
tsDataFrame = pandas.DataFrame(
[tuple(elem) for elem in ts.values],
index=ts.index.values
)
Is this the best-practices idiom for making this happen, or is there any sort of constructor or built-in that sort of “flattens” a column whose values are arrays into a set of columns?
How about something like this: