I want to delete specific strings with regular expressions from the column Sorte
which I don't want to have in my dataframe file_df
with the following code:
file_df = file_df[(file_df.Sorte != 'sonstige') & (file_df.Sorte != 'verauslagte Portokosten')
& (file_df.Sorte != 'erhaltenenzahlung Re vom')
& (file_df.Sorte != 'geleistetenzahlung aus Re-Nr')
& (file_df.Sorte != '^.*Holzkisten geliefert.*$')
& (file_df.Sorte != '^.*Infomaterialktionspakete.*$')
& (file_df.Sorte != '^.*Aloe Vera haben wir nicht im Sortiment.*$')
& (file_df.Sorte != '^.*Anzeigenvorlage Planten ut`norden.*$')]
But somehow when I execute this code these strings still are in the dataset and I can not figure out why. I wanted to chain this expression to not create so many copies.
Update
The code worked for some strings in the dataset, for others not.