• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Python – How to search for entries in a panda dataframe based on entries (list) in another column?

Resolved: Python – How to search for entries in a panda dataframe based on entries (list) in another column?

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

Question:

I am new to Python and dataframes. I have a big panda dataframe I need to extract information from, I will try to explain my problem in a small example. Say my dataframe looks like this:
Now I have a list with entries that relate to the column “number”
and I want to have the corresponding entries in another list from the “name” column
Is there an existing function for this problem?

Answer:

You did not explain your desired output, but:
If you want to filter by one of the cirteria:
will leave you with rows within the numbers array.
If you want both:
Don’t forget the names array to strings:

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

dataframe pandas python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: TypeScript does not recognize properties when instantiating interface array

27/03/2023

Resolved: How to make statement case insensitive when uploading a dta file with specified columns?

27/03/2023

Resolved: Sort dataframe columns value by close it to another column

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

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