code: def to_categorical(x, n_col=None):
      """One-hot encoding of nominal values"""
      if not n_col:
          n_col = np.amax(x) + 1
      one_hot = np.zeros((x.shape[0], n_col))
      one_hot[np.arange(x.shape[0]), x] = 1
      return one_hot
  
file_path: ML-From-Scratch/mlfromscratch/utils/data_manipulation.py
imports: from __future__ import division
  from itertools import combinations_with_replacement
  import numpy
  import math
  import sys
label_desc: Use image node_id 10 for calling a global function with example usage: to_categorical(x, n_col) and returns: one_hot