When using pandas to filter excel,
df.loc[df['threat_type'].str.contains("DGA")]
The following error messages appear:
ValueError: Cannot mask with non-boolean array containing NA/NaN values
It is reported that the grouping column contains non-string contents. Because the use of .Str.contains requires that the field must be a string and cannot have numbers,
so it is added to the code
df.loc[df['threat_type'].str.contains("DGA", na=False)]
This enables the function to directly ignore non-string situations.