[Numpy-discussion] Response to PEP suggestions

Chris Barker Chris.Barker at noaa.gov
Fri Feb 18 11:14:18 CST 2005


Travis Oliphant wrote:

> I'm still thinking about the X.flat possibility.

There was a discussion about his a while back, but I don't remember what 
conclusions were reached (if any). The technical details are beyond me, 
but it seems quite clear to me that A.flat() should be supported for all 
arrays. Otherwise, it makes it very hard to write generic code. What's 
the point of having discontiguous arrays if you can't use them 
everywhere you can use contiguous ones?


Fernando Perez wrote:
> Granted, the indexing will be costlier for a non-contiguous object, but 
> for the external users this provides a clean API.

Right. A number of things are costlier for non-contiguous arrays. If you 
need to optimize, you can make sure your arrays are contiguous where it 
matters. If you don't, it should "just work"


> But Python is not Matlab!
> 
> Konrad.

hear! hear!. If I wanted Matlab, I'd use Matlab (or Octave, or Psilab)







-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the Numpy-discussion mailing list