Re: [Numpy-discussion] Reading a big netcdf file

2011-08-03 Thread Ian Stokes-Rees
On 8/3/11 12:50 PM, Christopher Barker wrote: > As a reference, reading that much data in from a raw file into a numpy > array takes 2.57 on my machine (a rather old Mac, but disks haven't > gotten much faster). 2.57 seconds? or minutes? If seconds, does it actually read the whole thing into mem

[Numpy-discussion] Problems with numpy binary for Python2.7 + OS X 10.6

2011-07-25 Thread Ian Stokes-Rees
As best I can tell, I have Python 2.7.2 for my system Python: [ijstokes@moose ~]$ python -V Python 2.7.2 [ijstokes@moose ~]$ which python /Library/Frameworks/Python.framework/Versions/2.7/bin/python however when I attempt to install the recent numpy binary python-2.7.2-macosx10.6.dmg I get stop

Re: [Numpy-discussion] Grid indexing

2011-02-28 Thread Ian Stokes-Rees
On 2/26/11 3:36 AM, Wolfgang Kerzendorf wrote: > I have a n dimensional grid. The grids axes are linear but not > intergers. Let's say I want the value in gridcell [3.2,-5.6,0.01]. Is > there an easy way to transform the index? Do I have to write my own > class to accomplish this. Is there an

[Numpy-discussion] How to control column for pretty print line wrap of ndarrays

2010-12-22 Thread Ian Stokes-Rees
Like most people these days, I have multiple 24" monitors. I don't need "print" of ndarrays to wrap after 72 columns. Is there some way to change this? TIA Ian CURRENT: [NaN NaN NaN NaN NaN 5.1882094 1.19646584]] DESIRED: [NaN Na

Re: [Numpy-discussion] counting non-zero entries in an ndarray

2010-12-22 Thread Ian Stokes-Rees
On 12/22/10 9:16 AM, Ian Stokes-Rees wrote: > What is the most efficient way to do the Matlab equivalent of nnz(M) > (nnz = number-of-non-zeros function)? Thanks to all the various responses. I should have mentioned that I'm using scipy.sparse, and lil_matrix objects have a met

[Numpy-discussion] counting non-zero entries in an ndarray

2010-12-22 Thread Ian Stokes-Rees
What is the most efficient way to do the Matlab equivalent of nnz(M) (nnz = number-of-non-zeros function)? I've tried Google, but no luck. My assumption is that something like a != 0 will be used, but I'm not sure then how to "count" the number of "True" entries. TIA. Ian <>__

Re: [Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-29 Thread Ian Stokes-Rees
> Note that there are various extant projects that I think attempt to > provide similar functionality to what you're wanting (unless I badly > misread your original email, in which case apologies): > http://projects.scipy.org/numpy/wiki/NdarrayWithNamedAxes Having looked into it more, I think

Re: [Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-29 Thread Ian Stokes-Rees
>> But wouldn't the performance hit only come when I use it in this way? >> __getattr__ is only called if the named attribute is *not* found (I >> guess it falls off the end of the case statement, or is the result of >> the attribute hash table "miss"). > That's why I said that __getattr__ would p

Re: [Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-28 Thread Ian Stokes-Rees
On 10/28/10 5:29 PM, Robert Kern wrote: > On Thu, Oct 28, 2010 at 15:17, Ian Stokes-Rees > wrote: >> I have an ndarray with named dimensions. I find myself writing some >> fairly laborious code with lots of square brackets and quotes. It seems >> like it wouldn

[Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-28 Thread Ian Stokes-Rees
I have an ndarray with named dimensions. I find myself writing some fairly laborious code with lots of square brackets and quotes. It seems like it wouldn't be such a big deal to overload __getattribute__ so instead of doing: r = genfromtxt('results.dat',dtype=[('a','int'), ('b', 'f8'), ('c','in

Re: [Numpy-discussion] Scipy Conference 2009 Lecture Recordings

2009-07-16 Thread Ian Stokes-Rees
> The open source community is all about volunteering and with that > being said, I wouldn't expect the conference organizers to necessarily > be involved in the cooridination of such an initiative. > > I almost feel its a duty of someone to pick up the ball and run with it. But keep in mind th

Re: [Numpy-discussion] Scipy Conference 2009 Lecture Recordings

2009-07-16 Thread Ian Stokes-Rees
place. Ian -- Ian Stokes-ReesW: http://sbgrid.org ijsto...@crystal.harvard.edu T: +1 617 432-5608 x75 SBGrid, Harvard Medical School F: +1 617 432-5600 ___ NumPy-Discussion mailing list NumPy-Discu

[Numpy-discussion] Selecting "column" from array of tuples

2009-07-09 Thread Ian Stokes-Rees
en(lines),len(dtype)), dtype=dtype) ... results[idx]= [score, rfac, codefull, code2, subset] or indexing into the array: results[:,0] results[:,1] results[:].take(0) results[:][0] # this works, but doesn't return the desired first column Any suggestions greatly appreciate

Re: [Numpy-discussion] Test: My replies do not apear on the list

2009-07-09 Thread Ian Stokes-Rees
ion > -- Ian Stokes-ReesW: http://sbgrid.org ijsto...@crystal.harvard.edu T: +1 617 432-5608 x75 SBGrid, Harvard Medical School F: +1 617 432-5600 ___ NumPy-Discussion mailing list NumPy-Discu