Hi,
A calculation which goes like this...
n = 5
a = np.arange(1000)
b = np.arange(n - 1, 1000)
l = []
for i in range(b.size):
# Absolute difference of n a elements and nth b element
x = np.abs(a[i:i + n] - b[i])
# Average of x
y = x.sum() / n
l.append(y)
It takes a while if I have like 200K records!
Is there a more efficient way to do this using numpy?
Thanks
Vishal Rana
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion