Skip to content

Instantly share code, notes, and snippets.

@andreaschandra
Created April 2, 2018 15:36
Show Gist options
  • Save andreaschandra/8a922c8f39d995250627cb04b891ed72 to your computer and use it in GitHub Desktop.
Save andreaschandra/8a922c8f39d995250627cb04b891ed72 to your computer and use it in GitHub Desktop.
input = np.array([[8,2,3],
[4,7,1],
[9,2,6]])
data_biner = preprocessing.Binarizer(threshold = 5).transform(input)
output:
[[1 0 0]
[0 1 0]
[1 0 1]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment