Robert Kern wrote: >>>> x = np.array([1,2,3]) >>>> timeit x.sum() >> 100000 loops, best of 3: 3.01 µs per loop >>>> from numpy import sum >>>> timeit sum(x) >> 100000 loops, best of 3: 4.84 µs per loop
that is a VERY short array, so one extra function call overhead could make the difference. Is it really your use case to have such tiny sums inside a big loop, and is there no way to vectorize that? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion