访问十分位数据结构中的值

时间:2018-04-10 20:56:58

标签: pandas series

我这样做

dec = df.groupby(pd.qcut(df.num,10)).mean() 
dec.unstack=1
dnum  = dec['num'] 
dnum

这会产生一个带有无标题列的结构:

num
(-0.001, 4.0]       1.807960
(4.0, 9.0]          7.008487
(9.0, 17.0]        13.341535
(17.0, 26.0]       21.971478
(26.0, 36.0]       31.369977
(36.0, 48.0]       42.212227
(48.0, 63.0]       55.994531
(63.0, 77.0]       70.219310
(77.0, 107.0]      90.825823
(107.0, 307.0]    143.040535
Name: num, dtype: float64

如何仅访问第二列,以便我获得一个系列

1.807960, 7.008487, etc. ? 

0 个答案:

没有答案