Vote count: 0
I have pandas data frame called log_data and I'm detecting outliers in the data frame using the code
display(log_data[~((log_data[feature] >= Q1 - step) & (log_data[feature] <= Q3 + step))])
where
Q1 = np.percentile(log_data[feature],25)
Q3 = np.percentile(log_data[feature],75)
step = 1.5 * (Q3 - Q1)
Can anyone tell me what '~' is doing in the code
display(log_data[~((log_data[feature] >= Q1 - step) & (log_data[feature] <= Q3 + step))])
asked 41 secs ago
1 Answer
Vote count: 0
~ is for inverting boolean mask.
answered 4 secs ago
What does ~ mean in python program?
Aucun commentaire:
Enregistrer un commentaire