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
  Transform 3 Columns into Single Column DaveG 9 3,581 Mar-19-2025, 03:46 AM
Last Post: robbert23
  Converting column of values into muliple columns of counts highland44 0 907 Feb-01-2024, 12:48 AM
Last Post: highland44
  How to check multiple columns value within range SamLiu 2 2,156 Mar-13-2023, 09:32 AM
Last Post: SamLiu
  Create multiple/single csv file for each sql records mg24 6 2,841 Sep-29-2022, 08:06 AM
Last Post: buran
  How to split the input taken from user into a single character? mHosseinDS86 3 2,163 Aug-17-2022, 12:43 PM
Last Post: Pedroski55
  How to combine multiple column values into 1? cubangt 15 6,896 Aug-11-2022, 08:25 PM
Last Post: cubangt
  How to move multiple columns to initial position SriRajesh 4 2,654 Jul-02-2022, 10:34 AM
Last Post: deanhystad
  Reshaping a single column in to multiple column using Python sahar 7 3,590 Jun-20-2022, 12:35 PM
Last Post: deanhystad
  df column aggregate and group by multiple columns SriRajesh 0 1,648 May-06-2022, 02:26 PM
Last Post: SriRajesh
  How to split file by same values from column from imported CSV file? Paqqno 5 5,692 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