Re: [Numpy-discussion] Specially Constructed Arrays

2009-04-08 Thread Robert Kern
On Wed, Apr 8, 2009 at 20:39, Ian Mallett wrote: > Hello, > > I want to make an array of size sqrt(n) by sqrt(n) by 3, filled with special > values. > > The values range from 0.0 to 3.0, starting with 0.0 at one corner and ending > at 3.0 in the opposite, increasing going row by row.  The value is

Re: [Numpy-discussion] using reducing functions without eliminating dimensions?

2009-04-08 Thread Robert Kern
On Thu, Apr 9, 2009 at 01:29, Anne Archibald wrote: > What's wrong with np.amin(a,axis=-1)[...,np.newaxis]? It's cumbersome, particularly when you have axis=arbitrary_axis. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our

Re: [Numpy-discussion] using reducing functions without eliminating dimensions?

2009-04-08 Thread Anne Archibald
2009/4/9 Charles R Harris : > > > On Tue, Apr 7, 2009 at 12:44 PM, Dan Lenski wrote: >> >> Hi all, >> >> I often want to use some kind of dimension-reducing function (like min(), >> max(), sum(), mean()) on an array without actually removing the last >> dimension, so that I can then do operations

Re: [Numpy-discussion] DVCS at PyCon

2009-04-08 Thread David Cournapeau
On Wed, Apr 8, 2009 at 3:34 AM, Ondrej Certik wrote: > Yes. Do you have any windows developers (I am sorry, I am not familiar at all with sympy)? My main concern with git are: - you may need the command line - the index can be confusing (you can avoid learning it at first, but still some erro

Re: [Numpy-discussion] using reducing functions without eliminating dimensions?

2009-04-08 Thread Charles R Harris
On Tue, Apr 7, 2009 at 12:44 PM, Dan Lenski wrote: > Hi all, > > I often want to use some kind of dimension-reducing function (like min(), > max(), sum(), mean()) on an array without actually removing the last > dimension, so that I can then do operations broadcasting the reduced > array back to

Re: [Numpy-discussion] Blas / lapack / binary installers...

2009-04-08 Thread David Cournapeau
Matthew Brett wrote: > > Yes it does... > Ok. > Yes, I know, hence my suggestion of something more practical in the > short term. I wonder whether the installer could be: > > by default, smallish, with just numpy, with the option of pulling down > the lapack libraries from the web on installa

Re: [Numpy-discussion] Blas / lapack / binary installers...

2009-04-08 Thread Gael Varoquaux
On Thu, Apr 09, 2009 at 11:11:13AM +0900, David Cournapeau wrote: > > No problem of course if we've done a development install - we already > > needed to have blas/lapack. > I am not sure I understand: why do you need blas/lapack to build > projects ? Does NiPY itself uses blas/lapack ? NiPy us

Re: [Numpy-discussion] Blas / lapack / binary installers...

2009-04-08 Thread Matthew Brett
Hi, >> We at the NIPY project have run into what seems like a recurring >> problem; we want to build our code against both numpy and lapack, on >> windows, linux and OS X. >> >> No problem of course if we've done a development install - we already >> needed to have blas/lapack. > > I am not sure I

Re: [Numpy-discussion] Blas / lapack / binary installers...

2009-04-08 Thread David Cournapeau
Hi Matthew, On Thu, Apr 9, 2009 at 4:44 AM, Matthew Brett wrote: > Hello, > > Summary: is it possible to distribute, optionally or not, the blas / > lapack libraries that numpy is built against, with the numpy binary > installers? Yes, it is possible. > We at the NIPY project have run into what

[Numpy-discussion] Specially Constructed Arrays

2009-04-08 Thread Ian Mallett
Hello, I want to make an array of size sqrt(n) by sqrt(n) by 3, filled with special values. The values range from 0.0 to 3.0, starting with 0.0 at one corner and ending at 3.0 in the opposite, increasing going row by row. The value is to be encoded in each color. Because this is somewhat abstra

Re: [Numpy-discussion] dtype field renaming

2009-04-08 Thread Stéfan van der Walt
2009/4/9 Pierre GM : >> a.dtype.names = ('c', 'd') > > Now that's wicked neat trick ! I love it ! Faster than taking a view > for sure. > Note that rename_fields should work also w/ nested fields (not that > common, true). Yes, that is slightly more effort: In [30]: arr = np.array(((2,3),), dtype

Re: [Numpy-discussion] dtype field renaming

2009-04-08 Thread Pierre GM
On Apr 8, 2009, at 6:18 PM, Stéfan van der Walt wrote: > 2009/4/9 Pierre GM : >>> for a numpy.recarray, is it possible to rename the fields in the >>> dtype? >> >> Take a new view: >> >>> a = np.array([(1,1)],dtype=[('a',int),('b',int)]) >> >>> b = a.view([("A",int), ('b', int)]) >> >> or: >> >

Re: [Numpy-discussion] dtype field renaming

2009-04-08 Thread Stéfan van der Walt
2009/4/9 Pierre GM : >> for a numpy.recarray, is it possible to rename the fields in the >> dtype? > > Take a new view: >  >>> a = np.array([(1,1)],dtype=[('a',int),('b',int)]) >  >>> b = a.view([("A",int), ('b', int)]) > > or: > > use numpy.lib.recfunctions.rename_fields Or change the names tuple

Re: [Numpy-discussion] dtype field renaming

2009-04-08 Thread Pierre GM
On Apr 8, 2009, at 5:57 PM, Elaine Angelino wrote: > hi there -- > > for a numpy.recarray, is it possible to rename the fields in the > dtype? Take a new view: >>> a = np.array([(1,1)],dtype=[('a',int),('b',int)]) >>> b = a.view([("A",int), ('b', int)]) or: use numpy.lib.recfunctions.renam

[Numpy-discussion] dtype field renaming

2009-04-08 Thread Elaine Angelino
hi there -- for a numpy.recarray, is it possible to rename the fields in the dtype? thanks a bunch elaine ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Blas / lapack / binary installers...

2009-04-08 Thread Gael Varoquaux
On Wed, Apr 08, 2009 at 12:44:02PM -0700, Matthew Brett wrote: > Summary: is it possible to distribute, optionally or not, the blas / > lapack libraries that numpy is built against, with the numpy binary > installers? You mean the unlinked libraries (.a or .so), and the corresponding headers, I be

[Numpy-discussion] Blas / lapack / binary installers...

2009-04-08 Thread Matthew Brett
Hello, Summary: is it possible to distribute, optionally or not, the blas / lapack libraries that numpy is built against, with the numpy binary installers? We at the NIPY project have run into what seems like a recurring problem; we want to build our code against both numpy and lapack, on windows

Re: [Numpy-discussion] trouble building docs with sphinx-0.6.1

2009-04-08 Thread Pauli Virtanen
Wed, 08 Apr 2009 09:59:50 +0200, Gael Varoquaux kirjoitti: > On Wed, Apr 01, 2009 at 08:40:15PM +, Pauli Virtanen wrote: >> It was an incompatibility of Numpy's autosummary extension and Sphinx >> >= 0.6. It should now be fixed in Numpy trunk. > > autosummary is now in Sphinx (>= 0.6). Shouldn

Re: [Numpy-discussion] Got: "undefined symbol: PyUnicodeUCS2_FromUnicode" error

2009-04-08 Thread Michael Abshoff
charlie wrote: > Hi All, Hi Charlie, > I got the "undefined symbol: PyUnicodeUCS2_FromUnicode" error when > importing numpy. > > I have my own non-root version of python 2.5.4 final installed with > --prefix=$HOME/usr. > PYTHONHOME=$HOME/usr; > PYTHONPATH="$PYTHONHOME/lib:$PYTHONHOME/lib/python

Re: [Numpy-discussion] Got: "undefined symbol: PyUnicodeUCS2_FromUnicode" error

2009-04-08 Thread David Cournapeau
charlie wrote: > Hi All, > > I got the "undefined symbol: PyUnicodeUCS2_FromUnicode" error when > importing numpy. > > I have my own non-root version of python 2.5.4 final installed with > --prefix=$HOME/usr. > PYTHONHOME=$HOME/usr; > PYTHONPATH="$PYTHONHOME/lib:$PYTHONHOME/lib/python2.5/site-pack

Re: [Numpy-discussion] Got: "undefined symbol: PyUnicodeUCS2_FromUnicode" error

2009-04-08 Thread Robert Kern
On Wed, Apr 8, 2009 at 03:05, charlie wrote: > Hi All, > > I got the  "undefined symbol: PyUnicodeUCS2_FromUnicode" error when > importing numpy. > > I have my own non-root version of python 2.5.4 final installed with > --prefix=$HOME/usr. > PYTHONHOME=$HOME/usr; > PYTHONPATH="$PYTHONHOME/lib:$PYT

[Numpy-discussion] Got: "undefined symbol: PyUnicodeUCS2_FromUnicode" error

2009-04-08 Thread charlie
Hi All, I got the "undefined symbol: PyUnicodeUCS2_FromUnicode" error when importing numpy. I have my own non-root version of python 2.5.4 final installed with --prefix=$HOME/usr. PYTHONHOME=$HOME/usr; PYTHONPATH="$PYTHONHOME/lib:$PYTHONHOME/lib/python2.5/site-packages/" install and import other

Re: [Numpy-discussion] trouble building docs with sphinx-0.6.1

2009-04-08 Thread Gael Varoquaux
On Wed, Apr 01, 2009 at 08:40:15PM +, Pauli Virtanen wrote: > It was an incompatibility of Numpy's autosummary extension and > Sphinx >= 0.6. It should now be fixed in Numpy trunk. autosummary is now in Sphinx (>= 0.6). Shouldn't we be using Sphinx's version, and default to ours for versions

Re: [Numpy-discussion] array of matrices

2009-04-08 Thread Gael Varoquaux
On Wed, Apr 01, 2009 at 01:40:54AM +, Hans-Andreas Engel wrote: > By the way, matrix multiplication is one of the testcases for the generalized > ufuncs in numpy 1.3 -- this makes playing around with it easy: > In [1]: N = 10; a = randn(N, 4, 4); b = randn(N, 4, 4) > In [2]: import numpy.

Re: [Numpy-discussion] using numpy array data in C++ matrix template library (MTL) matrices

2009-04-08 Thread David Cournapeau
David Cournapeau wrote: > The details will depend on your matrix library, but the underlying numpy > array object has a full C api, so you can do whatever you want with it > in your C++ code. But it can get quite messy :) > > I don't know for MTL, and for C++, boost can be useful, like Neal > sugge