Skip to content

Instantly share code, notes, and snippets.

@mytrile

mytrile/test.py Secret

Created June 22, 2012 14:30
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 mytrile/971051827fd54ce6248b to your computer and use it in GitHub Desktop.
Save mytrile/971051827fd54ce6248b to your computer and use it in GitHub Desktop.
import numpy as np
import random
data = np.zeros(10000000,'i')
idx = [random.randint(0,10000000-1) for x in range(10)]
data[idx] = 1
print data.nonzero()[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment