Re: [Numpy-discussion] NumPy in PyPy

2016-08-08 Thread Chris Barker
> > On Fri, Aug 5, 2016 at 3:42 AM, Papa, Florin >> wrote: >> >>> Does anyone have knowledge of real life workloads that use NumPy and >>> cannot be run using PyPy? >>> >>> >>> >>> We are also interested in creating a repository with relevant benchmarks >>> for real world

Re: [Numpy-discussion] Views and Increments

2016-08-08 Thread Stephan Hoyer
On Mon, Aug 8, 2016 at 6:11 AM, Anakim Border wrote: > Alternative version: > > >>> a = np.arange(10) > >>> a[np.array([1,6,5])] += 1 > >>> a > array([0, 2, 2, 3, 4, 6, 7, 7, 8, 9]) > I haven't checked, but a likely explanation is that Python itself interprets a[b] += c as

Re: [Numpy-discussion] Views and Increments

2016-08-08 Thread Marten van Kerkwijk
Hi Anakim, The difference is really in the code path that gets taken: in the first case, you go through `a.__getitem__(np.array([1,6,5])`, in the second through `a.__setitem__(...)`. The increments would not work if you added an extra indexing to it, as in: ``` a[np.array([1,6,5])][:] += 1 ```

[Numpy-discussion] PR 7918 apply_along_axis()

2016-08-08 Thread Ben Rowland
Hi list, This is both my first post to this list and first pull request for numpy so apologies if this is not the right list or for any other mistakes. Here is the link to my pull request: https://github.com/numpy/numpy/pull/7918 It is a simple

Re: [Numpy-discussion] Views and Increments

2016-08-08 Thread Sebastian Berg
On Mo, 2016-08-08 at 15:11 +0200, Anakim Border wrote: > Dear List, > > I'm experimenting with views and array indexing. I have written two > code blocks that I was expecting to produce the same result. > > First try: > > >>> a = np.arange(10) > >>> b = a[np.array([1,6,5])] > >>> b += 1 > >>> a

[Numpy-discussion] Views and Increments

2016-08-08 Thread Anakim Border
Dear List, I'm experimenting with views and array indexing. I have written two code blocks that I was expecting to produce the same result. First try: >>> a = np.arange(10) >>> b = a[np.array([1,6,5])] >>> b += 1 >>> a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) Alternative version: >>> a =