• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Python – lookup a value from another df multiple times

Resolved: Python – lookup a value from another df multiple times

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have the following two dataframes:
Bascially, I want all numbers in column land_ids to individually join the other df.
The result should look something like this:
Preferrably, the column list_land is one string where the lands are concatenated. But I would also be fine with getting a list as a result.
Any idea on how to do this?
Here is my code for creating the df:
EDIT: what do I have to add if one value of land_ids is empty?

Answer:

you can use the apply method:
In this case, the list_land column is a list. You can use the following code if you want it to be a string.

If you have better answer, please add a comment about this, thank you!

merge pandas python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Why reference in pointer array doesn’t have data?

24/03/2023

Resolved: EntityFramework creates/runs migrations using parameterless DataContext instance

24/03/2023

Resolved: Visual Studio 2022 crashes when using breakpoints

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.