Skip to content

Commit 85b267a

Browse files
committed
Added support for categorical datatype in rank - issue#15420
1 parent b94186d commit 85b267a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/algorithms.py

+4
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,10 @@ def _get_data_algo(values, func_map):
989989
f = func_map['uint64']
990990
values = _ensure_uint64(values)
991991

992+
elif is_categorical_dtype(values):
993+
f = func_map['int64']
994+
values = _ensure_int64(values.codes)
995+
992996
else:
993997
values = _ensure_object(values)
994998

0 commit comments

Comments
 (0)