class_docstr: Simple encoder that assigns a unique integer to every observed label.
  
  Allocates an `unknown` label by default to index 0.
  
  Labels must be exact matches between inference and training (e.g. no .lower() on strings is performed here).
class_docstr_tok: ["Simple","encoder","that","assigns","a","unique","integer","to","every","observed","label",".","Allocates","an","`","unknown","`","label","by","default","to","index","0",".","Labels","must","be","exact","matches","between","inference","and","training","(","e.g",".","no",".lower","(",")","on","strings","is","performed","here",")","."]
code: def prepare(self, priming_data: Union[list, pd.Series]) -> None:
      if not isinstance(priming_data, pd.Series):
          priming_data = pd.Series(priming_data)
  
      for i, v in enumerate(priming_data.unique()):
          if v is not None:
              self.label_map[str(v)] = int(i + 1)  # leave 0 for UNK
      self.n_labels = len(self.label_map)
      for k, v in self.label_map.items():
          self.inv_label_map[v] = k
      self.is_prepared = True
  
file_path: lightwood/lightwood/encoder/categorical/simple_label.py
imports: from typing import List, Union
  from collections import defaultdict
  import pandas
  import numpy
  import torch
  from lightwood.encoder.base import BaseEncoder
  from lightwood.helpers.constants import _UNCOMMON_WORD
label_desc: Use image node_id 2 for calling the SimpleLabelEncoder obj's underlying member method code with example usage: obj.prepare(priming_data) without return types