数据集:
id MarketPlaceValuation
0 100
1 250
2 200
3 100
4 325
5 175
6 150
7 125
8 225
9 325
10 625
11 100
12 75
13 100
14 200
15 225
.. ..
40 425
41 100
42 275
43 200
44 250
45 500
46 225
47 400
48 75
49 200
等等。 其中市场估值值介于1-100000之间。你知道吗
样本输出应为:
Valuation Segment
1-250
251-500
501-1000
1001-1500
1501-2000
2001-3000
3001-4000
4001-5000
5001-100000
我试着跟着:
df.groupby(pd.cut(df['MarketPlaceValuation'], np.arange(0,501,250))).count()
但是没有得到正确的输出。你知道吗
接下来,我要根据这个列范围得到其他列的平均值。你知道吗
我想你需要:
相关问题 更多 >
编程相关推荐