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 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 > something similar fir

Re: [Numpy-discussion] Decimal arrays?

2011-08-20 Thread Robert Kern
On Sat, Aug 20, 2011 at 17:49, Chris Withers wrote: > On 20/08/2011 15:38, Robert Kern wrote: >> On Sat, Aug 20, 2011 at 17:37, Chris Withers  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 >>

Re: [Numpy-discussion] Decimal arrays?

2011-08-20 Thread Charles R Harris
On Sat, Aug 20, 2011 at 4:49 PM, Chris Withers wrote: > On 20/08/2011 15:38, Robert Kern wrote: > > On Sat, Aug 20, 2011 at 17:37, Chris Withers > 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 po

[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 ha

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 Withers 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 are the pe

Re: [Numpy-discussion] Decimal arrays?

2011-08-20 Thread Robert Kern
On Sat, Aug 20, 2011 at 17:37, Chris Withers 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 world is an enigma

[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] 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 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 = (a>1) # np.array([[False,True],[True,True]]) > > How would a[b,np.newaxis] be supposed to work? > > Note t

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 wrote: > On Fri, Aug 19, 2011 at 3:05 PM, Mark Wiebe wrote: > > On Fri, Aug 19, 2011 at 11:44 AM, Charles R Harris > > wrote: > >> > >> > >> > >> > >> My main peeve is that NA is upper case ;) I suppose that could use some > >> discussion. > > > >

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 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 ' 'float64' as that is the arr

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 nev

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.

[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] 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 = (a>1) # 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 a[:1,np.new