2011/9/27 Olivier Delalleau
> 2011/9/27 Zbigniew Jędrzejewski-Szmek
>
>> On 09/22/2011 12:09 PM, Pauli Virtanen wrote:
>> > Thu, 22 Sep 2011 08:12:12 +0200, Han Genuit wrote:
>> > [clip]
>> >> I also noticed that it does strange things when using a list:
>> >>
>> > c[[True, False, True]]
>>
2011/9/27 Zbigniew Jędrzejewski-Szmek
> On 09/22/2011 12:09 PM, Pauli Virtanen wrote:
> > Thu, 22 Sep 2011 08:12:12 +0200, Han Genuit wrote:
> > [clip]
> >> I also noticed that it does strange things when using a list:
> >>
> > c[[True, False, True]]
> >> array([[3, 4, 5],
> >> [0, 1,
On 09/22/2011 12:09 PM, Pauli Virtanen wrote:
> Thu, 22 Sep 2011 08:12:12 +0200, Han Genuit wrote:
> [clip]
>> I also noticed that it does strange things when using a list:
>>
> c[[True, False, True]]
>> array([[3, 4, 5],
>> [0, 1, 2],
>> [3, 4, 5]])
>
> It casts the list with b
Thu, 22 Sep 2011 08:12:12 +0200, Han Genuit wrote:
[clip]
> I also noticed that it does strange things when using a list:
>
c[[True, False, True]]
> array([[3, 4, 5],
>[0, 1, 2],
>[3, 4, 5]])
It casts the list with booleans to an integer array. Probably shouldn't
work like t
2011/9/20 Stéfan van der Walt
> On Tue, Sep 20, 2011 at 12:43 AM, Robert Kern
> wrote:
> > If the array is short in a dimension, it gets implicitly continued
> > with Falses. You can see this in one dimension:
>
> [...]
>
> > I honestly don't know if this is documented or tested anywhere or even
On Tue, Sep 20, 2011 at 12:43 AM, Robert Kern wrote:
> If the array is short in a dimension, it gets implicitly continued
> with Falses. You can see this in one dimension:
[...]
> I honestly don't know if this is documented or tested anywhere or even
> if this existed in older versions.
The beh
2011/9/20 Stéfan van der Walt :
> Hi all,
>
> Matthew Brett showed me an interesting code snippet this evening:
>
> # Construct input data
>
> In [15]: x
> Out[15]:
> array([[ 0, 1, 2],
> [ 3, 4, 5],
> [ 6, 7, 8],
> [ 9, 10, 11]])
>
> # Fancy indexing with 1D boolean array
>
Hi all,
Matthew Brett showed me an interesting code snippet this evening:
# Construct input data
In [15]: x
Out[15]:
array([[ 0, 1, 2],
[ 3, 4, 5],
[ 6, 7, 8],
[ 9, 10, 11]])
# Fancy indexing with 1D boolean array
In [16]: x[np.array([True, False, True])]
Out[16]:
ar