Re: [Numpy-discussion] Does x[True] trigger basic or advanced indexing?

2017-12-14 Thread Joe
Hi, you are right. I am using two different versions, Numpy 1.10.4 and 1.9.0 Both show this behavior. Numpy 1.11.1 also does, but now raises VisibleDeprecationWarning: using a boolean instead of an integer will result in an error in the future Thanks! Am 14.12.2017 21:37 schrieb Sebastian

Re: [Numpy-discussion] Does x[True] trigger basic or advanced indexing?

2017-12-14 Thread Sebastian Berg
On Thu, 2017-12-14 at 16:24 +, Eric Wieser wrote: > It sounds like you're using an old version of numpy, where boolean > scalars were interpreted as integers. > What version are you using? > Eric > Indeed, you are maybe using a pre 1.9 version (post 1.9 should at least have a

Re: [Numpy-discussion] Does x[True] trigger basic or advanced indexing?

2017-12-14 Thread Joe
Hello, thanks for you feedback. Sorry, if thie question is stupid and the case below does not make sense. I am just trying to understand the logic. For x = np.random.rand(2,3) x[True] x[(True,)] or x[False] x[(False,)] where True and False are not arrays, it will pick the first or second

Re: [Numpy-discussion] Does x[True] trigger basic or advanced indexing?

2017-12-13 Thread Eric Wieser
Increasingly, NumPy does not considers booleans to be integer types, and indexing is one of these cases. So no, it will not be treated as a tuple of integers, but as a 0d mask Eric On Wed, 13 Dec 2017 at 12:44 Joe wrote: > Hi, > > yet another question. > > I looked

[Numpy-discussion] Does x[True] trigger basic or advanced indexing?

2017-12-13 Thread Joe
Hi, yet another question. I looked through the indexing rules in the documentation but I count not find which one applies to x[True] and x[False] that might e.g result from import numpy as np x = np.array(3) x[x>5] x[x<1] x[True] x[False] x = np.random.rand(2,3) x[x>5] x[x<1] x[True]