Skip to content

Instantly share code, notes, and snippets.

@VibhuJawa

VibhuJawa/old_category.md Secret

Created Jul 27, 2020
Embed
What would you like to do?
import nvcategory
import nvstrings
import cudf
import numpy as np


nvs_s = nvstrings.to_device(['dog', 'fish', 'cat'])
nvcat_s = nvcategory.from_strings(nvs_s)
values_d_ar = rmm.device_array(shape=nvcat_s.size(),dtype=np.int32)
nvcat_s.values(devptr=values_d_ar.device_ctypes_pointer.value)
cudf.Series(values_d_ar)
0    1
1    2
2    0
dtype: int32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment