Python Forum
Merging rows and adding columns based on matching index
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Merging rows and adding columns based on matching index
#1
Hello community, tried this a million different ways with pandas groupby but no luck, any help is appreciated. First year learning python and still trying to figure things out. Thanks!

ID name code
ABC hans apple
ABC hans pear
ABC hans kale
DEF holly tomato
HIJ jon grapes

ID name code 1 code 2 code 3
ABC hans apple pear kale
DEF holly tomato
HIJ jon grapes
Reply


Messages In This Thread
Merging rows and adding columns based on matching index - by pythonnewbie78 - Dec-21-2023, 04:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas Dataframe Filtering based on rows mvdlm 0 1,540 Apr-02-2022, 06:39 PM
Last Post: mvdlm
  [Pandas] Help with finding only non-matching rows LowEnd 3 3,896 Nov-12-2021, 02:34 PM
Last Post: jefsummers
  numpy adding columns rwahdan 4 2,493 Sep-21-2021, 08:25 PM
Last Post: deanhystad
  [split] Getting Index Error - list index out of range krishna 2 2,726 Jan-09-2021, 08:29 AM
Last Post: buran
  Extracting rows based on condition on one column Robotguy 2 2,320 Aug-07-2020, 02:27 AM
Last Post: Robotguy
  Dropping Rows From A Data Frame Based On A Variable JoeDainton123 1 2,311 Aug-03-2020, 02:05 AM
Last Post: scidam
Question Dividing a single column of dataframe into multiple columns based on char length darpInd 2 2,584 Mar-14-2020, 09:19 AM
Last Post: scidam
  Getting Index Error - list index out of range RahulSingh 2 6,280 Feb-03-2020, 07:17 AM
Last Post: RahulSingh
  Merging two DataFrames based on indexes from two other DataFrames lucinda_rigeitti 0 1,827 Jan-16-2020, 08:36 PM
Last Post: lucinda_rigeitti
  read_csv error and rows/columns missing karlito 9 5,610 Nov-11-2019, 06:48 AM
Last Post: karlito

Forum Jump:

User Panel Messages

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