Python Forum
validate the existing value and change the series
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
validate the existing value and change the series
#1
Hello Everyone.

I am new to the Python and this Forum. I have the requirement to generate the new set of dataset

Source Dataset

ID SRC_VAL TGT_VAL
1 A [B,C]
2 D [E,F]
3 G [B,H]

Output dataset

ID SRC_VAL
B 1
C 1
E 2
F 2
B 3
H 3


The Desired output is
ID SRC_VAL
B [1,3]
C [1]
E [2]
H [3]
F [ 2]

Can anyone help me in getting the desired output.
Thanks in Advance
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using shift to compute the percent change in a time series new_to_python 6 4,200 Mar-03-2020, 07:50 PM
Last Post: new_to_python
  pandas change row value an existing column with conditionals Gigux 1 2,974 Jun-22-2019, 08:04 PM
Last Post: Gigux
  Updating the Pandas dataframe to existing excel workbook in existing worksheet. sanmaya 1 9,774 Jul-01-2018, 06:23 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

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