函数定义
pandas.cut(x, bins, right=True, labels=None, retbins=False, precision=3, include_lowest=False, duplicates='raise', ordered=True)
-
Bin values into discrete intervals.
-
Use cut when you need to segment and sort data values into bins.
-
This function is also useful for going from a continuous variable to a categorical variable. For example, cut could convert ages to groups of age ranges. Supports binning into an equal number of bins, or a pre-specified array of bins.
函数定义
-
x: array-like
The input array to be binned. Must be 1-dimensional.