currently working on python and newbie on it. I have a data frame consisting of two columns id and parent id
id | parent
1 | A
2 | B
3 | C
4 | A
5 | A
6 | C
A | NaN
B | NaN
C | NaN
And the expected output is like the table given below:
id | parent | child
1 | A | NaN
2 | B | NaN
3 | C | NaN
4 | A | NaN
5 | A | NaN
6 | C | NaN
A | NaN | 1 ; 4 ; 5
B | NaN | 2
C | NaN | 3 ; 6
I have tried using fillna() function on it but couldn't got expected results.