Skip to content
Advertisement

How to search for name in dataframe

For example I want to find all the people that has “Abbott” in their name

JavaScript

df.loc[name in df[“Name”]] I tried this and it didn’t work

JavaScript

Advertisement

Answer

You can use str.contains with the column you are interested in searching

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement