[Numpy-discussion] Can this be done more efficiently using numpy?
Thu Apr 1 01:13:54 CDT 2010
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
It takes a while if I have like 200K records!
Is there a more efficient way to do this using numpy?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion