Skip to content

Instantly share code, notes, and snippets.

@bmtgoncalves
Last active September 11, 2016 16:09
Show Gist options
  • Save bmtgoncalves/cfe1da71686798b14c0763a48873339f to your computer and use it in GitHub Desktop.
Save bmtgoncalves/cfe1da71686798b14c0763a48873339f to your computer and use it in GitHub Desktop.
Uncorrelated and Minimum functions
def uncorrelated(data, steps=10):
N = len(data)
for i in range(steps*N):
pos = np.random.randint(N) # Select an element at random
data[pos] = np.random.random() # Replace the value
return data
def minimum(data, steps=10):
N = len(data)
for i in range(steps*N):
pos = np.argmin(data) # Find the position of the minimum value
data[pos] = np.random.random() # Replace the value
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment