code: def _series_to_tensor(series):
      if is_categorical(series):
          return torch.LongTensor(
              series.cat.codes.values.astype("int64")
          )
      else:  # numeric
          return torch.FloatTensor(series.values)
  
file_path: dgl/examples/pytorch/pinsage/builder.py
imports: from collections import namedtuple
  import dgl
  from pandas.api.types import is_categorical, is_categorical_dtype, is_numeric_dtype
label_desc: Use image node_id 1 for calling a global function with example usage: _series_to_tensor(series) and returns: torch, torch