How to add a new column value based on condition?Having two data set as follows: First data set contain 2 columns as follows:
Start | End |
---|---|
A | B |
A | C |
A | D |
B | A |
B | C |
B | E |
---------- | ---------------- |
Second data set contain 3 columns.
start | End | time |
---|---|---|
A | B | 8 |
A | D | 9 |
A | E | 10 |
B | A | 7 |
B | E | 4 |
---------- | ---------------- | ---- |
If the start and end are same, add the time with the first data set.How to merge these two columns in python as follows.
Start | End | Time |
---|---|---|
A | B | 8 |
A | C | nan |
A | D | 9 |
B | A | 7 |
B | C | nan |
B | E | 4 |
---------- | ---------------- | ---- |