I have a pretty basic problem that I'm having trouble explaining verbally, otherwise, I would just use an older answer. Would definitely appreciate being pointed in the right direction
Here's an example of what I need assistance with:
Project Name A | Population A | Project Name B | Population B | |
---|---|---|---|---|
0 | Zebra | Zebra | 124 | |
1 | Horse | Parrot | 555 | |
2 | Parrot | |||
3 | Pufferfish | Shark | 442 | |
4 | Shark | |||
5 | Spider | Cow | 331 | |
6 | Pig | Pig | 953 | |
7 | Cow |
How would I be able to insert the population data from Population B into Population A, given that the column in the row next to it in Project Name B matches Project Name A?
Sorry I'm having trouble explaining this!
I tried using the loc function in Pandas inside a loop, but that did not work other than for the first row of data.