Python Forum

Full Version: Split single column to multiple columns
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I have pandas.core.Dataframe as below
When I write to csv using df.to_csv it placed in single columns and 8 rows with delimiter as comma(","). First row is A,B,C,D. I want to separate 4by1 to 4by4.
when I type df.columns it give Index([A,B,C,D]).

A,B,C,D
1,2,3,4
5,6,7,8,
9,1,3
Need to see your code defining and filling the dataframe to see why it is doing this.