I am trying to drop rows in my dataframe
The column
Field:FacilityCode
mama100
mimba190
mama1
mimba67
#delete invalid code from df
df = df[~df['Field:FacilityCode'].str.len()>8] | df[~df['Field:FacilityCode'].str.len()>7]
expected output
Field:FacilityCode
mama100
mimba190
here is the error
TypeError: ufunc 'invert' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'''
How can I fix it??