code: def ord2ohe(
      X_ord: np.ndarray, cat_vars_ord: dict
  ) -> Tuple[np.ndarray, dict]:
      """
      Convert ordinal to one-hot encoded variables.
  
      Parameters
      ----------
      X_ord
          Data with mixture of ordinal encoded and numerical variables.
      cat_vars_ord
          Dict with as keys the categorical columns and as values
          the number of categories per categorical variable.
  
      Returns
      -------
      One-hot equivalent of ordinal encoded data and dict with categorical columns and number of categories.
      """
      n, cols = X_ord.shape
      ord_vars_keys = list(cat_vars_ord.keys())
      X_list = []
      c = 0
      k = 0
      cat_vars_ohe = {}
      while c < cols:
          if c in ord_vars_keys:
              v = cat_vars_ord[c]
              X_ohe_c = np.zeros((n, v), dtype=np.float32)
              X_ohe_c[np.arange(n), X_ord[:, c].astype(int)] = 1.0
              cat_vars_ohe[k] = v
              k += v
              X_list.append(X_ohe_c)
          else:
              X_list.append(X_ord[:, c].reshape(n, 1))
              k += 1
          c += 1
      X_ohe = np.concatenate(X_list, axis=1)
      return X_ohe, cat_vars_ohe
  
imports: import numpy
  from typing import Tuple, List
label_desc: Use image node_id 4 for calling a global function with example usage: ord2ohe(X_ord, cat_vars_ord) and returns: X_ohe,  cat_vars_ohe