I'm using a pandas series and I want to find the index value that represents the quantile.
If I have:
np.random.seed(8) s = pd.Series(np.random.rand(6), ['a', 'b', 'c', 'd', 'e', 'f']) s a 0.873429 b 0.968541 c 0.869195 d 0.530856 e 0.232728 f 0.011399 dtype: float64 And do
s.quantile(.5) I get
0.70002511588475946 What I want to know is what is the index value of s that represents the point just before that quantile value. In this case I know the index value should be d.