'].value_counts()得到结果:2 31033 29131 22664 14120 587Name: num_cars_owned, dtype: int64...()此时x为ori_date['num_cars_owned'],bins=3。...得到结果:(2.667, 4.0] 4325(1.333, 2.667] 3103(-0.004, 1.333] 2853Name: num_cars_owned, dtype...5 测试cut函数中的right参数测试一下right函数为False的结果,代码如下:
pd.cut(ori_date['num_cars_owned'], [-1, 0, 2, 4], right...='False').value_counts()得到结果:(0, 2] 5369(2, 4] 4325(-1, 0] 587Name: num_cars_owned, dtype