Skip to content

Instantly share code, notes, and snippets.

@photizzo
Created January 5, 2018 22:44
Show Gist options
  • Save photizzo/c16535147d80307258a390f882afabcb to your computer and use it in GitHub Desktop.
Save photizzo/c16535147d80307258a390f882afabcb to your computer and use it in GitHub Desktop.
import numpy as np
a = (np.random.rand(1,10)) #create a random (1,10) array
print ("a: \n" + str(a))
result = (np.where(a>0.5,1,0))
print ("result: \n" +str(result))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment