Just as a quick note, I find it *very* common and handy to do something
like:
someCount = (x > 5).sum()
which requires implicit upcasting of np.bool_ to integer. Just making sure
that usecase isn't forgotten, as it had to be mentioned the last time this
subject came up.
On Mon, Mar 21, 2022 at
On Wed, 2022-03-16 at 18:14 +, Jacob Reinhold wrote:
> Hi Sebastian and Chuck,
>
> Thanks for the response! (Sorry about the formatting in my original
> post, I wasn't familiar with how to display code in this setting).
>
> I think keeping + as "logical or" and * as "logical and" on np.bool_
Hi Sebastian and Chuck,
Thanks for the response! (Sorry about the formatting in my original post, I
wasn't familiar with how to display code in this setting).
I think keeping + as "logical or" and * as "logical and" on np.bool_ types is
fine, although redundant given that | and & provide this f
Hi Jacob,
adding to what Chuck mentioned, a few inline comments if you are
interested in some gory details.
On Sat, 2022-03-12 at 21:40 +, Jacob Reinhold wrote:
> A pain point I ran into a while ago was assuming that an np.ndarray
> with dtype=np.bool_ would act similarly to the Python built
On Sun, Mar 13, 2022 at 10:31 AM Charles R Harris
wrote:
>
>
> On Sat, Mar 12, 2022 at 4:53 PM Jacob Reinhold
> wrote:
>
>> A pain point I ran into a while ago was assuming that an np.ndarray with
>> dtype=np.bool_ would act similarly to the Python built-in boolean under
>> addition. This is not
On Sat, Mar 12, 2022 at 4:53 PM Jacob Reinhold wrote:
> A pain point I ran into a while ago was assuming that an np.ndarray with
> dtype=np.bool_ would act similarly to the Python built-in boolean under
> addition. This is not the case, as shown in the following code snippet:
>
> >>> np.bool_(Tru