Python Forum
Add column based on others
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add column based on others
#7
Hi there

Thank you for your idea!
I recently sorted the problem using a for-loop with a empty id column and if current_id == old_id then id = id + 1
and using iloc for the transformation.

Your idea seems more elegant though!

Have a nice easterweeekend!
Tim
Reply


Messages In This Thread
Add column based on others - by timste - Mar-27-2021, 10:52 AM
RE: Add column based on others - by eddywinch82 - Mar-27-2021, 09:05 PM
RE: Add column based on others - by timste - Mar-27-2021, 09:52 PM
RE: Add column based on others - by jefsummers - Mar-29-2021, 12:17 AM
RE: Add column based on others - by devesh_sahu - Apr-01-2021, 09:20 AM
RE: Add column based on others - by devesh_sahu - Apr-01-2021, 09:24 AM
RE: Add column based on others - by timste - Apr-01-2021, 09:49 AM
RE: Add column based on others - by devesh_sahu - Apr-03-2021, 07:37 AM
RE: Add column based on others - by devesh_sahu - Apr-03-2021, 07:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Make unique id in vectorized way based on text data column with similarity scoring ill8 0 898 Dec-12-2022, 03:22 AM
Last Post: ill8
  New Dataframe Column Based on Several Conditions nb1214 1 1,823 Nov-16-2021, 10:52 PM
Last Post: jefsummers
  Pandas Data frame column condition check based on length of the value aditi06 1 2,707 Jul-28-2021, 11:08 AM
Last Post: jefsummers
Question [Solved] How to refer to dataframe column name based on a list lorensa74 1 2,281 May-17-2021, 07:02 AM
Last Post: lorensa74
  Extracting rows based on condition on one column Robotguy 2 2,233 Aug-07-2020, 02:27 AM
Last Post: Robotguy
  Filter data based on a value from another dataframe column and create a file using lo pawanmtm 1 4,300 Jul-15-2020, 06:20 PM
Last Post: pawanmtm
  Pandas - Dynamic column aggregation based on another column theroadbacktonature 0 3,072 Apr-17-2020, 04:54 PM
Last Post: theroadbacktonature
Question Dividing a single column of dataframe into multiple columns based on char length darpInd 2 2,485 Mar-14-2020, 09:19 AM
Last Post: scidam
  Sum product multiple Dataframes based on column headers. Lastwizzle 0 3,837 May-21-2019, 04:05 PM
Last Post: Lastwizzle
  Create selection box to pass string value based on uniques in Excel column sneakysnek 1 2,510 Nov-18-2018, 07:29 PM
Last Post: Stefanovietch

Forum Jump:

User Panel Messages

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