Python Forum
Split single column to multiple columns
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split single column to multiple columns
#1
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
Reply
#2
Need to see your code defining and filling the dataframe to see why it is doing this.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Converting column of values into muliple columns of counts highland44 0 256 Feb-01-2024, 12:48 AM
Last Post: highland44
  How to check multiple columns value within range SamLiu 2 1,153 Mar-13-2023, 09:32 AM
Last Post: SamLiu
  Create multiple/single csv file for each sql records mg24 6 1,399 Sep-29-2022, 08:06 AM
Last Post: buran
  How to split the input taken from user into a single character? mHosseinDS86 3 1,184 Aug-17-2022, 12:43 PM
Last Post: Pedroski55
  How to combine multiple column values into 1? cubangt 15 2,858 Aug-11-2022, 08:25 PM
Last Post: cubangt
  How to move multiple columns to initial position SriRajesh 4 1,435 Jul-02-2022, 10:34 AM
Last Post: deanhystad
  Reshaping a single column in to multiple column using Python sahar 7 2,065 Jun-20-2022, 12:35 PM
Last Post: deanhystad
  df column aggregate and group by multiple columns SriRajesh 0 1,046 May-06-2022, 02:26 PM
Last Post: SriRajesh
  Transform 3 Columns into Single Column DaveG 8 1,887 Apr-04-2022, 08:42 AM
Last Post: Pedroski55
  How to split file by same values from column from imported CSV file? Paqqno 5 2,800 Mar-24-2022, 05:25 PM
Last Post: Paqqno

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020