Last active
September 11, 2016 16:09
-
-
Save bmtgoncalves/cfe1da71686798b14c0763a48873339f to your computer and use it in GitHub Desktop.
Uncorrelated and Minimum functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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