Re: [Numpy-discussion] Can't mix np.newaxis with boolean indexing

2011-08-20 Thread Olivier Verdier
Your syntax is not as intuitive as you may think. Suppose I take a matrix instead a = np.array([1,2,3,4]).reshape(2,2) b = (a1) # np.array([[False,True],[True,True]]) How would a[b,np.newaxis] be supposed to work? Note that other (simple) slices work perfectly with newaxis, such as

[Numpy-discussion] RGB - HSV in numpy?

2011-08-20 Thread He Shiming
Hi, I'm wondering how to do RGB - HSV conversion in numpy. I found a couple solutions through stackoverflow, but somehow they can't be used in my array format. I understand the concept of conversion, but I'm not that familiar with numpy. My source buffer format is 'RGBA' sequence. I can take it

Re: [Numpy-discussion] RGB - HSV in numpy?

2011-08-20 Thread David Warde-Farley
On 2011-08-20, at 4:01 AM, He Shiming wrote: Hi, I'm wondering how to do RGB - HSV conversion in numpy. I found a couple solutions through stackoverflow, but somehow they can't be used in my array format. I understand the concept of conversion, but I'm not that familiar with numpy. My

Re: [Numpy-discussion] SVD does not converge on clean matrix

2011-08-20 Thread Gael Varoquaux
On Sun, Aug 14, 2011 at 09:15:35PM +0200, Charanpal Dhanjal wrote: Incidentally, I am confused as to why numpy calls the lapack lite routines - when I call numpy.show_config() it seems to have detected my ATLAS libraries and I would have expected it to use those. My rule of thumb is to never

Re: [Numpy-discussion] NA masks for NumPy are ready to test

2011-08-20 Thread Mark Wiebe
On Fri, Aug 19, 2011 at 11:37 AM, Bruce Southey bsout...@gmail.com wrote: Hi, Just some immediate minor observations that are really about trying to be consistent: 1) Could you keep the display of the NA dtype be the same as the array? For example, NA dtype is displayed as 'f8' but should

Re: [Numpy-discussion] NA masks for NumPy are ready to test

2011-08-20 Thread Mark Wiebe
On Fri, Aug 19, 2011 at 4:52 PM, Bruce Southey bsout...@gmail.com wrote: On Fri, Aug 19, 2011 at 3:05 PM, Mark Wiebe mwwi...@gmail.com wrote: On Fri, Aug 19, 2011 at 11:44 AM, Charles R Harris charlesr.har...@gmail.com wrote: snip My main peeve is that NA is upper case ;) I suppose

Re: [Numpy-discussion] Can't mix np.newaxis with boolean indexing

2011-08-20 Thread Benjamin Root
On Sat, Aug 20, 2011 at 2:47 AM, Olivier Verdier zelb...@gmail.com wrote: Your syntax is not as intuitive as you may think. Suppose I take a matrix instead a = np.array([1,2,3,4]).reshape(2,2) b = (a1) # np.array([[False,True],[True,True]]) How would a[b,np.newaxis] be supposed to work?

[Numpy-discussion] Decimal arrays?

2011-08-20 Thread Chris Withers
Hi All, What's the best type of array to use for decimal values? (ie: where I care about precision and want to avoid any possible rounding errors) cheers, Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk

Re: [Numpy-discussion] Decimal arrays?

2011-08-20 Thread Robert Kern
On Sat, Aug 20, 2011 at 17:37, Chris Withers ch...@simplistix.co.uk wrote: Hi All, What's the best type of array to use for decimal values? (ie: where I care about precision and want to avoid any possible rounding errors) dtype=object -- Robert Kern I have come to believe that the whole

Re: [Numpy-discussion] Decimal arrays?

2011-08-20 Thread Chris Withers
On 20/08/2011 15:38, Robert Kern wrote: On Sat, Aug 20, 2011 at 17:37, Chris Withersch...@simplistix.co.uk wrote: Hi All, What's the best type of array to use for decimal values? (ie: where I care about precision and want to avoid any possible rounding errors) dtype=object Thanks! What

[Numpy-discussion] saving groups of numpy arrays to disk

2011-08-20 Thread Chris Withers
Hi All, I've got a tree of nested dicts that at their leaves end in numpy arrays of identical sizes. What's the easiest way to persist these to disk so that I can pick up with them where I left off? What's the most correct way to do so? I'm using IPython if that makes things easier... I had

Re: [Numpy-discussion] Decimal arrays?

2011-08-20 Thread Charles R Harris
On Sat, Aug 20, 2011 at 4:49 PM, Chris Withers ch...@simplistix.co.ukwrote: On 20/08/2011 15:38, Robert Kern wrote: On Sat, Aug 20, 2011 at 17:37, Chris Withersch...@simplistix.co.uk wrote: Hi All, What's the best type of array to use for decimal values? (ie: where I care about

Re: [Numpy-discussion] Decimal arrays?

2011-08-20 Thread Robert Kern
On Sat, Aug 20, 2011 at 17:49, Chris Withers ch...@simplistix.co.uk wrote: On 20/08/2011 15:38, Robert Kern wrote: On Sat, Aug 20, 2011 at 17:37, Chris Withersch...@simplistix.co.uk  wrote: Hi All, What's the best type of array to use for decimal values? (ie: where I care about precision and

Re: [Numpy-discussion] RGB - HSV in numpy?

2011-08-20 Thread He Shiming
On Sat, Aug 20, 2011 at 4:17 PM, David Warde-Farley warde...@iro.umontreal.ca wrote: There are functions for this available in scikits.image: http://stefanv.github.com/scikits.image/api/scikits.image.color.html Although you may need to reshape it with reshape(arr, (width, height, 4)) or