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