Re: [Numpy-discussion] Unicode revisited

2012-08-03 Thread Ondřej Čertík
On Fri, Aug 3, 2012 at 6:03 PM, Travis Oliphant wrote: > Hey all, > > Ondrej has been working hard with feedback from many others on improving > Unicode support in NumPy (especially for Python 3.3). Looking at what > Python has done in Python 3.3 (PEP 393) and chatting on the Python issue > t

Re: [Numpy-discussion] Unicode revisited

2012-08-03 Thread Charles R Harris
On Fri, Aug 3, 2012 at 7:03 PM, Travis Oliphant wrote: > Hey all, > > Ondrej has been working hard with feedback from many others on improving > Unicode support in NumPy (especially for Python 3.3). Looking at what > Python has done in Python 3.3 (PEP 393) and chatting on the Python issue > tra

[Numpy-discussion] Unicode revisited

2012-08-03 Thread Travis Oliphant
Hey all, Ondrej has been working hard with feedback from many others on improving Unicode support in NumPy (especially for Python 3.3). Looking at what Python has done in Python 3.3 (PEP 393) and chatting on the Python issue tracker with the author of that PEP has made me wonder if we aren't

Re: [Numpy-discussion] 2 greatest values, in a 3-d array, along one axis

2012-08-03 Thread eat
Hi, On Fri, Aug 3, 2012 at 7:02 PM, Angus McMorland wrote: > On 3 August 2012 11:18, Jim Vickroy wrote: > >> Hello everyone, >> >> I'm trying to determine the 2 greatest values, in a 3-d array, along one >> axis. >> >> Here is an approach: >> >> # ---

Re: [Numpy-discussion] Licensing question

2012-08-03 Thread Dag Sverre Seljebotn
On 08/02/2012 10:44 PM, Damon McDougall wrote: > Hi, > > I have a question about the licence for NumPy's codebase. I am currently > writing a library and I'd like to release under some BSD-type licence. > Unfortunately, my choice to link against MIT's FFTW library (released > under the GPL) means t

Re: [Numpy-discussion] 2 greatest values, in a 3-d array, along one axis

2012-08-03 Thread Jim Vickroy
Thanks for each of the improved solutions. The one using argsort took a little while for me to understand. I have a long way to go to fully utilize fancy indexing! -- jv On 8/3/2012 10:02 AM, Angus McMorland wrote: On 3 August 2012 11:18, Jim Vickroy > wrote:

Re: [Numpy-discussion] 2 greatest values, in a 3-d array, along one axis

2012-08-03 Thread Angus McMorland
On 3 August 2012 11:18, Jim Vickroy wrote: > Hello everyone, > > I'm trying to determine the 2 greatest values, in a 3-d array, along one > axis. > > Here is an approach: > > # -- > # procedure to determine greatest 2 values for 3rd dimension of

Re: [Numpy-discussion] 2 greatest values, in a 3-d array, along one axis

2012-08-03 Thread Daπid
Here is the 3D implementation: http://pastebin.com/ERVLWhbS I was only able to do it using a double nested loop, but I am sure someone more clever than me can do a slicing trick to overcome it. Otherwise, I hope this is fast enough for your purpose. David. On Fri, Aug 3, 2012 at 4:41 PM, Daπid

Re: [Numpy-discussion] 2 greatest values, in a 3-d array, along one axis

2012-08-03 Thread Daπid
Here goes a 1D simple implementation. It shouldn't be difficult to generalize to more dimensions, as all the functions support axis argument: >>> a=np.array([1, 2, 3, 5, 2]) >>> a.max() # This is the maximum value 5 >>> mask=np.zeros_like(a) >>> mask[np.argmax(a)]=1 >>> a=np.ma.masked_array(a, ma

[Numpy-discussion] 2 greatest values, in a 3-d array, along one axis

2012-08-03 Thread Jim Vickroy
Hello everyone, I'm trying to determine the 2 greatest values, in a 3-d array, along one axis. Here is an approach: # -- # procedure to determine greatest 2 values for 3rd dimension of 3-d array ... import numpy, numpy.ma xcnt, ycnt, zcnt =

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-08-03 Thread Ondřej Čertík
On Mon, Jul 30, 2012 at 5:00 PM, Ronan Lamy wrote: > Le lundi 30 juillet 2012 à 11:07 -0700, Ondřej Čertík a écrit : >> On Mon, Jul 30, 2012 at 10:04 AM, Ronan Lamy wrote: >> > Le lundi 30 juillet 2012 à 17:10 +0100, Ronan Lamy a écrit : >> >> Le lundi 30 juillet 2012 à 04:57 +0100, Ronan Lamy a