[Numpy-discussion] Fancy indexing for

2009-09-22 Thread Daran Rife
): max_B[i,j] = B[tmax_idx[i,j],i,j] As you know, this is reasonably fast for modest-sized arrays, but is far more expensive for large arrays. Thanks in advance for your help. Sincerely, Daran Rife ___ NumPy-Discussion mailing list NumPy

Re: [Numpy-discussion] Fancy indexing for

2009-09-22 Thread Daran Rife
Hi Robert, This solution works beautifully! Thanks for sending it along. I need to learn and understand more about fancy indexing for multi-dimensional arrays, especially your clever trick of np.newaxis for broadcasting. Daran -- Hello list, This didn't seem to get through last time round,

Re: [Numpy-discussion] Efficient removal of duplicates

2008-12-15 Thread Daran Rife
How about a solution inspired by recipe 18.1 in the Python Cookbook, 2nd Ed: import numpy as np a = [(x0,y0), (x1,y1), ...] l = a.tolist() l.sort() unique = [x for i, x in enumerate(l) if not i or x != b[l-1]] a_unique = np.asarray(unique) Performance of this approach should be highly scalable.

Re: [Numpy-discussion] Efficient removal of duplicates

2008-12-15 Thread Daran Rife
15, 2008, at 5:24 PM, Daran Rife wrote: How about a solution inspired by recipe 18.1 in the Python Cookbook, 2nd Ed: import numpy as np a = [(x0,y0), (x1,y1), ...] l = a.tolist() l.sort() unique = [x for i, x in enumerate(l) if not i or x != b[l-1]] a_unique = np.asarray(unique

Re: [Numpy-discussion] Need **working** code example of 2-D arrays

2008-10-13 Thread Daran Rife
Ordinarily I avoid becoming involved in such acrimony, but I take this single opportunity to state clearly that I find Linda Seltzer's behavior utterly rude and childish. Having been a member of this mailing list for over 6 years, I take exception to the pointless ranting and vitriolic comments

Re: [Numpy-discussion] Request for porting pycdf to NumPy

2007-02-09 Thread Daran Rife
Yep, I was referring to: http://pysclint.sourceforge.net/pycdf/ Regarding the issue of deciding which netCDF interface to adopt as the standard, although it is unlikely we'll ever get consensus on this, I have tried several of the netCDF interfaces, including the one in Scientific, and have found