Re: [Numpy-discussion] building pynetcdf-0.7 on OS X 10.4 intel

2007-05-02 Thread Alan G Isaac
On Wed, 02 May 2007, Rob De Almeida apparently wrote: > http://cheeseshop.python.org/pypi/pupynere/ I do not think you were "shameless" enough. Pupynere is a PUre PYthon NEtcdf REader. It allows read-access to netCDF files using the same syntax as the Scientific.IO.Net

Re: [Numpy-discussion] building pynetcdf-0.7 on OS X 10.4 intel

2007-05-02 Thread Rob De Almeida
James Boyle wrote: > I am trying to build pynetcdf-0.7, so as to be able to read netCDF > files from python 2.5/numpy . Sorry for the shameless plug, but if you only want to read netCDF files from numpy you can use a pure python netcdf reader that I wrote, called pupynere: http://cheeses

[Numpy-discussion] building pynetcdf-0.7 on OS X 10.4 intel

2007-05-02 Thread James Boyle
OS X 10.4.9, python 2.5, numpy 1.0.3.dev3726, netcdf 3.6.2 I am trying to build pynetcdf-0.7, so as to be able to read netCDF files from python 2.5/numpy . So far I have not had success. Enclosed is the dump of my most recent failure - the complaint comes from the linker since the linker

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Christopher Barker
Pierre GM wrote: >> It didn't sound like the OP wanted that. I suspect that what is wanted >> if for to always be a 1-d array (i.e. vector). To do that, I'd do: > > I beg to differ: your option is equivalent to (and I suspect a bit slower > than) atleast_1d, which is what the OP complained about.

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Pierre GM
On Wednesday 02 May 2007 14:45:40 Christopher Barker wrote: > Pierre GM wrote: > > If you need your inputs to be array or scalar and stay that way > > It didn't sound like the OP wanted that. I suspect that what is wanted > if for to always be a 1-d array (i.e. vector). To do that, I'd do: I beg t

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Christopher Barker
Pierre GM wrote: > If you need your inputs to be array or scalar and stay that way It didn't sound like the OP wanted that. I suspect that what is wanted if for to always be a 1-d array (i.e. vector). To do that, I'd do: import numpy as N >>> def test(a): ...b = N.asarray(a, dtype=N.float)

Re: [Numpy-discussion] Possible Numeric bug with python-2.5

2007-05-02 Thread Pierre GM
On Wednesday 02 May 2007 14:15:06 Fernando Perez wrote: > On 5/2/07, Darren Dale <[EMAIL PROTECTED]> wrote: > > I know Numeric is no longer supported, but I just upgraded to python-2.5 > > and now I'm having problems indexing Numeric arrays: > > Fine on 32-bit ubuntu, using Python 2.5: > But I thi

Re: [Numpy-discussion] Possible Numeric bug with python-2.5

2007-05-02 Thread Fernando Perez
On 5/2/07, Darren Dale <[EMAIL PROTECTED]> wrote: > I know Numeric is no longer supported, but I just upgraded to python-2.5 and > now I'm having problems indexing Numeric arrays: Fine on 32-bit ubuntu, using Python 2.5: In [4]: Numeric.arange(0,10)[:] Out[4]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

[Numpy-discussion] Possible Numeric bug with python-2.5

2007-05-02 Thread Darren Dale
I know Numeric is no longer supported, but I just upgraded to python-2.5 and now I'm having problems indexing Numeric arrays: In [1]: import Numeric In [2]: Numeric.arange(0,10) Out[2]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) In [3]: Numeric.arange(0,10)[:10] Out[3]: array([0, 1, 2, 3, 4, 5, 6, 7

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Pierre GM
On Wednesday 02 May 2007 12:27:10 mark wrote: > Any reason NOT to have asarray(3,'d') return an array of length 1? Because then, it would be "an array, not necessarily a float" ;) You just noticed yourself that an array of dimension 1 is pretty much like a list, while an array of dimension 0 is

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Robert Kern
mark wrote: > OK, so in my example, I get a zero dimension array. Apparently a > feature, not a bug. > What I don't understand is why it isn't an array of lenght one? (or: > why it isn't a bug?) Because we need a way to get rank-0 arrays. > Is there any use for a zero dimension array? http://pro

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread mark
OK, so in my example, I get a zero dimension array. Apparently a feature, not a bug. What I don't understand is why it isn't an array of lenght one? (or: why it isn't a bug?) Is there any use for a zero dimension array? I would very much like it to be a one dimension array. In my application I don'

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Pierre GM
On Wednesday 02 May 2007 11:39:29 Francesc Altet wrote: > El dc 02 de 05 del 2007 a les 09:52 -0400, en/na Pierre GM va escriure: > > In your example: > > > >>> b = asarray(3,'d') > > > > b is really a numpy scalar, so it doesn't have a length. But it does have > > a size (1) and a ndim (0). > > Ju

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Francesc Altet
El dc 02 de 05 del 2007 a les 09:52 -0400, en/na Pierre GM va escriure: > Mark, > In your example: > > >>> b = asarray(3,'d') > > b is really a numpy scalar, so it doesn't have a length. But it does have a > size (1) and a ndim (0). Just one correction in terms of the current naming convention:

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Pierre GM
On Wednesday 02 May 2007 10:00:58 Charles R Harris wrote: > On 5/2/07, Pierre GM <[EMAIL PROTECTED]> wrote: > > Mark, > Or just array([1],'d') Except that in that case you need to know in advance the input is a scalar to put it in a list. The atleast_1d should work better on any input. _

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Charles R Harris
On 5/2/07, Pierre GM <[EMAIL PROTECTED]> wrote: Mark, In your example: > >>> b = asarray(3,'d') b is really a numpy scalar, so it doesn't have a length. But it does have a size (1) and a ndim (0). If you need to have arrays with a length, you can force the array to have a dimension 1 with atlea

Re: [Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread Pierre GM
Mark, In your example: > >>> b = asarray(3,'d') b is really a numpy scalar, so it doesn't have a length. But it does have a size (1) and a ndim (0). If you need to have arrays with a length, you can force the array to have a dimension 1 with atleast_1d(b) or array(b,copy=False,ndmin=1) _

Re: [Numpy-discussion] sort bug

2007-05-02 Thread Nils Wagner
mark wrote: > Sorry for joining this discussion late. > If you are only interested in the four largest eigenvalues, there are > more efficient algorithms out there than just eig(). > There are algorithms that just give you the N largest. > Then again, I don't know of any Python implementations, but

Re: [Numpy-discussion] bug in scipy.io.mmio

2007-05-02 Thread Nils Wagner
koara wrote: > Hello, when saving a sparse matrix via scipy 0.5.2: > scipy.io.mmio.mmwrite(), an exception is thrown: > > scipy.io.mmio.py: line 269: AttributeError: gettypecode not found > > changing the line to read > > 269: typecode = a.dtype.char > > fixes the problem. > > _

[Numpy-discussion] bug in scipy.io.mmio

2007-05-02 Thread koara
Hello, when saving a sparse matrix via scipy 0.5.2: scipy.io.mmio.mmwrite(), an exception is thrown: scipy.io.mmio.py: line 269: AttributeError: gettypecode not found changing the line to read 269: typecode = a.dtype.char fixes the problem. ___ Numpy

Re: [Numpy-discussion] sort bug

2007-05-02 Thread mark
Sorry for joining this discussion late. If you are only interested in the four largest eigenvalues, there are more efficient algorithms out there than just eig(). There are algorithms that just give you the N largest. Then again, I don't know of any Python implementations, but I haven't looked, Mar

[Numpy-discussion] problem: I get an array that doesn't have a length

2007-05-02 Thread mark
Hello - I try to convert an input argument to an array of floats. Input can be an array of integers or floats, or scalar integers or floats. The latter seem to give a problem, as they return an array that doesn't have a length. I don't quite understand what b really is in the example below. Doesn't

[Numpy-discussion] scipy for centos4.4?

2007-05-02 Thread Neal Becker
Anyone know where to find usable rpms from scipy on centos4.4? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] reporting scipy.sparse bug

2007-05-02 Thread Stefan van der Walt
On Tue, May 01, 2007 at 05:36:19PM -0700, koara wrote: > scipy 0.5.2, in scipy.sparse.lil_matrix.__mul__: the optimization for > when multiplying by zero scalar is flawed. A copy of the original > matrix is returned, rather than the correct zero matrix. Nasty bug > because it only manifests itself