code: def _maybe_dt_array(array):
      
      if not isinstance(array, DataTable) or array is None:
          return array
  
      if array.shape[1] > 1:
          raise ValueError('DataTable for label or weight cannot have multiple columns')
  
      # below requires new dt version
      # extract first column
      array = array.to_numpy()[:, 0].astype('float')
  
      return array
docs: Extract numpy array from single column data table