code: def _from_df_to_cupy(df):
      """Transform char columns to integer columns, and then create an array"""
      for col in df.columns:
          if not np.issubdtype(df[col].dtype, np.number):
              if isinstance(df, pd.DataFrame):
                  df[col] = [ord(c) for c in df[col]]
              else:
                  df[col] = [ord(c) for c in df[col].values_host]
      return cp.array(from_df_to_numpy(df))
  
imports: from sklearn.preprocessing import OneHotEncoder
  from cuml.testing.utils import stress_param, from_df_to_numpy, assert_inverse_equal, generate_inputs_from_categories
  from cuml.preprocessing import OneHotEncoder
  from cuml.internals.safe_imports import gpu_only_import_from
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
  import math
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: _from_df_to_cupy(df) and returns: cp