Skip to content

Instantly share code, notes, and snippets.

@fonnesbeck
Created May 2, 2016 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonnesbeck/f4a6c1ad97477d20c491ab2199a94b0b to your computer and use it in GitHub Desktop.
Save fonnesbeck/f4a6c1ad97477d20c491ab2199a94b0b to your computer and use it in GitHub Desktop.
One hot encoder
def hot_one_state(index):
array = np.zeros(NUM_STATES)
array[index] = 1.
return array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment