def ranking(x):
    return pd.Series(x).rank(pct=True).values[-1]
ranked = sx.expanding().apply(lambda x: ranking(x))
pd.cut(ranked, (0, 0.25, 0.75, 0.9, 1), labels=['low', 'Normal', 'High',
    'Very High'])
Pandas: How to create a category based on expanding quantile?