Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/branch-23.10' into offset-row-wi…
Browse files Browse the repository at this point in the history
…ndows-wip
  • Loading branch information
mythrocks committed Sep 20, 2023
2 parents 46de250 + e87d2fc commit b66fd14
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions python/cudf/cudf/core/column/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,20 +1390,19 @@ def _return_sentinel_column():
except ValueError:
return _return_sentinel_column()

codes = arange(len(cats), dtype=dtype)
left_gather_map, right_gather_map = cpp_join(
[self], [cats], how="left"
)
codes = codes.take(
right_gather_map, nullify=True, check_bounds=False
).fillna(na_sentinel.value)

codes = libcudf.copying.gather(
[arange(len(cats), dtype=dtype)], right_gather_map, nullify=True
)
del right_gather_map
# reorder `codes` so that its values correspond to the
# values of `self`:
order = arange(len(self))
order = order.take(left_gather_map, check_bounds=False).argsort()
codes = codes.take(order)
return codes
(codes,) = libcudf.sort.sort_by_key(
codes, [left_gather_map], [True], ["last"], stable=True
)
return codes.fillna(na_sentinel.value)


def column_empty_like(
Expand Down

0 comments on commit b66fd14

Please sign in to comment.