Skip to content

Instantly share code, notes, and snippets.

@VibhuJawa
Created July 27, 2020 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VibhuJawa/071a07e9806992cefb45b12150414097 to your computer and use it in GitHub Desktop.
Save VibhuJawa/071a07e9806992cefb45b12150414097 to your computer and use it in GitHub Desktop.
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