code: def encode_labels(df):
      pd = util.get_module(
          "pandas", required="Logging dataframes requires pandas"
      )
      preprocessing = util.get_module(
          "sklearn.preprocessing",
          "roc requires the scikit preprocessing submodule, install with `pip install scikit-learn`",
      )
  
      le = preprocessing.LabelEncoder()
      # apply le on categorical feature columns
      categorical_cols = df.select_dtypes(
          exclude=[
              "int",
              "float",
              "float64",
              "float32",
              "int32",
              "int64",
          ]
      ).columns
      df[categorical_cols] = df[categorical_cols].apply(
          lambda col: le.fit_transform(col)
      )
  
file_path: wandb/wandb/plots/utils.py
imports: from collections.abc import Iterable, Sequence
  import wandb
  from wandb import util
  from wandb.sdk.lib import deprecate
label_desc: Use image node_id 4 for calling a global function with example usage: encode_labels(df) without return types