I have a dataframe
with number of columns and hundreds lines.
What would be the simple and best performance way to find all lines in DataFrame
where cell in columns my_columns
has a substring : abc
I have a dataframe
with number of columns and hundreds lines.
What would be the simple and best performance way to find all lines in DataFrame
where cell in columns my_columns
has a substring : abc
Check the best answer here: How to select rows from a DataFrame based on column values? , it's all explained
print(df.loc[df['my_column'] == 'abc'])
try :
df[df['my_columns'].str.contains('abc')]