This is a follow up question from here
What is the best way to include the re flags inside the query.
The following way throws an error
condition = f"(col1.str.contains('{val}', flags={re}.IGNORECASE)"
df.query(condition)
Syntax Error:
....
File "<unknown>", line 1
col1.str.contains ('val',flags =<module 're'from '/xxxx/lib/python3.7/re.py'>.IGNORECASE )
SyntaxError: invalid syntax