code: def string_to_one_hot(string, maxchar):
      
      ascii = np.array([ord(c) for c in string]).T
      return np.array(ascii[:,None] == np.arange(maxchar)[None, :], dtype=int)
docs: Converts an ASCII string to a one-of-k encoding.