What I'm trying to do is:
options = ['abc', 'def']
df[any(df['a'].str.startswith(start) for start in options)]
I want to apply a filter so I only have entries that have values in the column 'a' starting with one of the given options.
the next code works, but I need it to work with several options of prefixes...
start = 'abc'
df[df['a'].str.startswith(start)]
The error message is
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Read Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all() but haven't got understanding of how to do so.