How to filter rows containing a string pattern from a Pandas dataframe [duplicate]

In [3]: df[df['ids'].str.contains("ball")]
Out[3]:
     ids  vals
0  aball     1
1  bball     2
3  fball     4

Leave a Comment