Python, Numpy
Is there a more compact way to operate on array elements, without having to use the standard for loop.?
For example, consider the function below:
filterData(A):
B = numpy.zeros(len(A));
B[0] = (A[0] + A[1])/2.0;
for i in range(1, len(A)):
B[i] = (A[i]-A[i-1])/2.0;
return B;