defget_quantile_count(group, q=0.5): group= group.sort_index(by='prop', ascending=False)returngroup.prop.cumsum().searchsorted(q)+1defvariety_growth(top1000):'''show the plot of sum of top1000.prop by year and