I have dataset where I want to eliminate all data above 95th percentile of a variable, let's say 'col1'. I have used np.quantile method to calculate 95th percentile data and filtered all value below than this data.
df_95 = df[df['col1'] < np.quantile(df['col1'], 0.95)]
The problem I am facing is that there are multiple datas with the 95th percentile value in the variable, and my code is removing data from the first instance of it. Whereas I want it to do it from exact 95th percentile only.