If you have a column of str and want to filter the rows with a specified expression, then you can select the rows in an easy way. Namely we want to have a short cut to the following logic.
s_matched = data[col].apply(lambda s: True if re.search(expr,s) else False)
return data[s_matched].copy()
If you have a column of str and want to filter the rows with a specified expression, then you can select the rows in an easy way. Namely we want to have a short cut to the following logic.