On Sat, Jun 8, 2013 at 7:54 AM, Robert Kern wrote:
> On Sat, Jun 8, 2013 at 12:40 PM, wrote:
>> Question about namespace
>>
>> why is there bool and bool_ ?
>>
> np.bool(True) + np.bool(True)
>> 2
> np.bool_(True) + np.bool_(True)
>> True
>>
> type(np.bool(True))
>>
> type(np.bo
On Sat, Jun 8, 2013 at 5:18 AM, Sebastian Berg
wrote:
> On Sat, 2013-06-08 at 00:48 +0100, Nathaniel Smith wrote:
>> On 7 Jun 2013 21:58, wrote:
>> >
>> > Interesting observation, (while lurking on a pull request)
>> >
>> > >>> np.add.reduce(np.arange(5)<3)
>> > 3
>> > >>> np.add((np.arange(5)<3)
On Sat, Jun 8, 2013 at 12:40 PM, wrote:
> Question about namespace
>
> why is there bool and bool_ ?
>
np.bool(True) + np.bool(True)
> 2
np.bool_(True) + np.bool_(True)
> True
>
type(np.bool(True))
>
type(np.bool_(True))
>
>
> I didn't pay attention to the trailing underline
Question about namespace
why is there bool and bool_ ?
>>> np.bool(True) + np.bool(True)
2
>>> np.bool_(True) + np.bool_(True)
True
>>> type(np.bool(True))
>>> type(np.bool_(True))
I didn't pay attention to the trailing underline in Pauli's original example
Josef
On Fri, 2013-06-07 at 20:29 -0400, josef.p...@gmail.com wrote:
> On Fri, Jun 7, 2013 at 8:08 PM, wrote:
> > On Fri, Jun 7, 2013 at 7:48 PM, Nathaniel Smith wrote:
> >> On 7 Jun 2013 21:58, wrote:
> >>>
> >>> Interesting observation, (while lurking on a pull request)
> >>>
> >>> >>> np.add.reduc
08.06.2013 02:48, Nathaniel Smith kirjoitti:
[clip]
> ...yeah weird. My gut reaction is that it's a bug. Addition on bools
> should either be an error, undefined but doable via an implicit upcast
> to int (analogous to calling np.sin on an int array triggering an upcast
> to float), or xor (i.e., a
On Sat, 2013-06-08 at 00:48 +0100, Nathaniel Smith wrote:
> On 7 Jun 2013 21:58, wrote:
> >
> > Interesting observation, (while lurking on a pull request)
> >
> > >>> np.add.reduce(np.arange(5)<3)
> > 3
> > >>> np.add((np.arange(5)<3), (np.arange(5)<3))
> > array([ True, True, True, False, False
On Fri, Jun 7, 2013 at 8:08 PM, wrote:
> On Fri, Jun 7, 2013 at 7:48 PM, Nathaniel Smith wrote:
>> On 7 Jun 2013 21:58, wrote:
>>>
>>> Interesting observation, (while lurking on a pull request)
>>>
>>> >>> np.add.reduce(np.arange(5)<3)
>>> 3
>>> >>> np.add((np.arange(5)<3), (np.arange(5)<3))
>>
On Fri, Jun 7, 2013 at 7:48 PM, Nathaniel Smith wrote:
> On 7 Jun 2013 21:58, wrote:
>>
>> Interesting observation, (while lurking on a pull request)
>>
>> >>> np.add.reduce(np.arange(5)<3)
>> 3
>> >>> np.add((np.arange(5)<3), (np.arange(5)<3))
>> array([ True, True, True, False, False], dtype=
On 7 Jun 2013 21:58, wrote:
>
> Interesting observation, (while lurking on a pull request)
>
> >>> np.add.reduce(np.arange(5)<3)
> 3
> >>> np.add((np.arange(5)<3), (np.arange(5)<3))
> array([ True, True, True, False, False], dtype=bool)
>
>
> I often use summing of an array of boolean but didn't
Interesting observation, (while lurking on a pull request)
>>> np.add.reduce(np.arange(5)<3)
3
>>> np.add((np.arange(5)<3), (np.arange(5)<3))
array([ True, True, True, False, False], dtype=bool)
I often use summing of an array of boolean but didn't know the second behavior
Josef
_
11 matches
Mail list logo