I need to convert the Indices of a Series amounts
into its Columns. For example, I need to convert:
1983-05-15 1
1983-11-15 1
1984-05-15 1
1984-11-15 101
into:
1983-05-15 1983-11-15 1984-05-15 1984-11-15
1 1 1 101
I wasn't able to find any documentation on doing this for Series
type Objects specifically and don't know how to do this.
Thank You
Build a DataFrame
out of your Series
, then the .T
property returns a transposed version.
In [87]: pd.DataFrame(s).T
Out[87]:
1983-05-15 1983-11-15 1984-05-15 1984-11-15
0 1 1 1 101
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments