Re: [Numpy-discussion] summation along a non-fast axis

2019-01-11 Thread Sebastian Berg
On Fri, 2019-01-11 at 12:32 -0800, Keith Goodman wrote: > I remember back when a.sum(axis=0) was much slower than a.sum(axis=1) > for something like a=np.ones((1000, 1000)). But now it runs in about > the same time. How does numpy do it? > "now" is since numpy 1.7 or so :). > Does numpy do somet

[Numpy-discussion] summation along a non-fast axis

2019-01-11 Thread Keith Goodman
I remember back when a.sum(axis=0) was much slower than a.sum(axis=1) for something like a=np.ones((1000, 1000)). But now it runs in about the same time. How does numpy do it? Does numpy do something like for i in range(a.shape[0]): for j in range(x.shape[1]): result[j] += a[i, j] ___