-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Open
Labels
EnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.cutcut, qcutcut, qcut
Description
Followup to #31290. Currently pd.cut
doesn't play nicely with all extension arrays. To support them, I think we'll need one addition to the interface.
We need an array of integers to pass to searchsorted in
pandas/pandas/core/reshape/tile.py
Line 394 in 4edcc55
ids = ensure_int64(bins.searchsorted(x, side=side)) |
It doesn't matter what value is used for missing values, as long as it's distinct.
We can't quite use factorize(arr)[0]
since it doesn't have the ordering requirement.
bernwaldl
Metadata
Metadata
Assignees
Labels
EnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.cutcut, qcutcut, qcut