Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Returns the normalised correlation (a number that represents the similarity) between lists of y coordinates
- #Note: ENSURE that and both lists are of identical length, delta x remains constant and x coordinate is common to both lists
- import numpy as np
- a = [0, 1, 0.5]
- b = [100, 1, 0.5]
- output = np.correlate((a - np.mean(a)) / (np.std(a) * len(a)), (b - np.mean(b)) / np.std(b)) #Normalised correlation
- print output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement