I have a pandas DataFrame called data with a column called ms. I want to eliminate all the rows where data.ms is above the 95% percentile. For now, I'm doing this:
limit = data.ms.describe(90)['95%']
valid_data = data[data['ms'] < limit]
which works, but I want to generalize that to any percentile. What's the best way to do that?