[Numpy-discussion] improved NumPy support for boolean arrays?
Robert Kern
robert.kern@gmail....
Wed Aug 5 15:04:10 CDT 2009
On Wed, Aug 5, 2009 at 15:01, Dr. Phillip M.
Feldman<pfeldman@verizon.net> wrote:
>
> Although I've used Matlab for many years and am quite new to Python, I'm
> already convinced that the Python/NumPy combination is more powerful and
> flexible than the Matlab base, and that it generally takes less Python code
> to get the same job done. There is, however, at least one thing that is much
> cleaner in Matlab-- operations on boolean arrays. If x and y are numpy
> arrays of bools, I'd like to be able to create expressions like the
> following:
>
> not x (to invert each element of x)
~x
> x and y
x & y
> x or y
x | y
> x xor y
x ^ y
> (not x) or y
(~x) | y
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion
mailing list