Pandas, find and delete rows
This is a bit more robust than wwnde's answer, as it will work if some of the columns aren't originally strings:
df.loc[~df.apply(lambda x: any('-' in str(col) for col in x), axis = 1)]
If you have data that's stored as datetime, it will display as having -, but will return an error if you check for inclusion without converting to str first. Negative numbers will also return True once converted to str. If you want different behavior, you'll have to do something more complicated, such as
df.loc[~df.apply(lambda x: any('-' in col if isinstance(col, str) else False for col in x), axis = 1)]
Been searching for a while in order to understand how to do this basic task without any success which is very strange.
I have a dataset where some of the rows contain '-', I have no clue under which columns these values lie.
How do I search in the whole dataset (including all columns) for '-' and drop the rows containing this value?
thank you!