@@ -28,10 +28,10 @@ def cut(x, bins, right=True, labels=None, retbins=False, precision=3,
28
28
"""
29
29
Bin `x` and return data about the bin to which each `x` value belongs.
30
30
31
- This function splits `x` into the specified number of equal-width half-
32
- open bins. Based on the parameters specified and the input, returns
33
- information about the half-open bins to which each value of `x` belongs
34
- or the bins themselves.
31
+ Splits `x` into the specified number of equal-width half-open bins.
32
+ Based on the parameters specified and the input, returns data about
33
+ the half-open bins to which each value of `x` belongs or the bins
34
+ themselves.
35
35
Use `cut` when you need to segment and sort data values into bins. This
36
36
function is also useful for going from a continuous variable to a
37
37
categorical variable. For example, `cut` could convert ages to groups
@@ -108,7 +108,7 @@ def cut(x, bins, right=True, labels=None, retbins=False, precision=3,
108
108
[good, good, good, medium, bad, good]
109
109
Categories (3, object): [good < medium < bad]
110
110
111
- >>> pd.cut(np.ones(5), 4, labels=False)
111
+ >>> pd.cut(np.ones(5, dtype='int64' ), 4, labels=False)
112
112
array([1, 1, 1, 1, 1], dtype=int64)
113
113
114
114
>>> s = pd.Series(np.array([2,4,6,8,10]), index=['a', 'b', 'c', 'd', 'e'])
0 commit comments