[Numpy-discussion] transpose and putmask questions.

Chris Barker chrishbarker at home.net
Fri May 18 13:09:36 EDT 2001


"Paul F. Dubois" wrote:

>> 1) why does the array passed as the first argument to putmask have to be
>> contiguous? this can be a substantial limitation, I end up making copies
>> when I have no other reason to.
> -----> because nobody has implemented the general case; feel free to
> volunteer.

Fair enough. I have yet to open up the NumPy code myself, but I have
written some custom extensions with it, and have a number of small
improvements in mind that I would like to make. Hopefully I will get to
this some day.

> b) No one has gotten around to making the code smart enough to do this
> when it is unambigous.?
> ------> Numpy's attitude toward extra dimensions of length 1 is somewhat
> schizophrenic.
>         If you know you want one-d you can put a ravel() around it.
> 
>         In general the answer to your question is (b) but it is very
> complicated so that is why people don't work on it.

I suspected as much. I'm starting to get used to it. I think my problem
is that I come from MATLAB, where everything is a 2-d array.

Thanks for your comments.

-Chris


-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------




More information about the NumPy-Discussion mailing list