[Numpy-discussion] Memory hungry reduce ops in Numpy

2011-11-14 Thread Andreas Müller
Hi everybody. When I did some normalization using numpy, I noticed that numpy.std uses more ram than I was expecting. A quick google search gave me this: http://luispedro.org/software/ncreduce The site claims that std and other reduce operations are implemented naively with many temporaries. Is

Re: [Numpy-discussion] ANN: SciPy 0.10.0 released

2011-11-14 Thread Jean-Baptiste Marquette
Le 13 nov. 2011 à 20:19, Ralf Gommers a écrit : I am pleased to announce the availability of SciPy 0.10.0. Hi all, Thanks for this great job. I've run nosetests on my Mac (64-bit 10.7.2 build on EPD) which fails on the following test: test_definition (test_basic.TestDoubleIFFT) ... FAIL

Re: [Numpy-discussion] Memory hungry reduce ops in Numpy

2011-11-14 Thread David Cournapeau
On Mon, Nov 14, 2011 at 12:46 PM, Andreas Müller amuel...@ais.uni-bonn.de wrote: Hi everybody. When I did some normalization using numpy, I noticed that numpy.std uses more ram than I was expecting. A quick google search gave me this: http://luispedro.org/software/ncreduce The site claims

Re: [Numpy-discussion] Memory hungry reduce ops in Numpy

2011-11-14 Thread Andreas Müller
On 11/14/2011 04:23 PM, David Cournapeau wrote: On Mon, Nov 14, 2011 at 12:46 PM, Andreas Müller amuel...@ais.uni-bonn.de wrote: Hi everybody. When I did some normalization using numpy, I noticed that numpy.std uses more ram than I was expecting. A quick google search gave me this:

Re: [Numpy-discussion] Rebinning numpy array

2011-11-14 Thread Sturla Molden
Fit a poisson distribution (radioactive decay is a Poisson process), recompute lambda for whatever bin-size you need, and compute the new (estimated) bin counts by maximum likehood. It basically becomes a contrained optimization problem. Sturla Den 13.11.2011 17:04, skrev Johannes Bauer: Hi

[Numpy-discussion] Copy netcdf attributes between different files

2011-11-14 Thread Giovanni Plantageneto
Hi everybody, I am using netCDF4 library to read and write from netcdf files. I would like to copy all the attributes of one file to another one, in a way like this: --- from netCDF4 import Dataset as ncdf file1 = ncdf('file1.nc', mode='r', format='NETCDF4_CLASSIC') ... file2 = ncdf('file1.nc',

Re: [Numpy-discussion] Copy netcdf attributes between different files

2011-11-14 Thread Jeff Whitaker
On 11/14/11 10:04 AM, Giovanni Plantageneto wrote: Hi everybody, I am using netCDF4 library to read and write from netcdf files. I would like to copy all the attributes of one file to another one, in a way like this: --- from netCDF4 import Dataset as ncdf file1 = ncdf('file1.nc',

Re: [Numpy-discussion] Copy netcdf attributes between different files

2011-11-14 Thread Olivier Delalleau
In Python you use setattr to set an object's attribute whose name is stored into a variable: setattr(file2, att, file1.getncatt(att)) -=- Olivier 2011/11/14 Giovanni Plantageneto g.plantagen...@gmail.com Hi everybody, I am using netCDF4 library to read and write from netcdf files. I would

Re: [Numpy-discussion] Rebinning numpy array

2011-11-14 Thread Chris.Barker
On 11/13/11 9:55 AM, Olivier Delalleau wrote: idea, since it will throw out a lot of information if you decrease the number of bins: I agree -- I'd think about looking at a smooth interpolation -- maybe kernel density estimation? On 11/14/11 8:12 AM, Sturla Molden wrote: Fit a poisson

Re: [Numpy-discussion] how to use the name of a ndarray as a string

2011-11-14 Thread Chris.Barker
On 11/10/11 3:57 AM, Olivier Delalleau wrote: In such a situation you should probably use a dictionary from the start, all good suggestions, but while we're at it: On 11/10/11 2:17 AM, Chao YUE wrote: Does anyone know how I can quickly use the name of a ndarray as a string? This reflects a

Re: [Numpy-discussion] Copy netcdf attributes between different files

2011-11-14 Thread Giovanni Plantageneto
Yes, thanks! It works, but the syntax is setattr(flle2,att,getattr(file1,att)) 2011/11/14 Jeff Whitaker jsw...@fastmail.fm: On 11/14/11 10:04 AM, Giovanni Plantageneto wrote: Hi everybody, I am using netCDF4 library to read and write from netcdf files. I would like to copy all the attributes

Re: [Numpy-discussion] ANN: SciPy 0.10.0 released

2011-11-14 Thread Ralf Gommers
On Mon, Nov 14, 2011 at 3:04 PM, Jean-Baptiste Marquette marqu...@iap.frwrote: Le 13 nov. 2011 à 20:19, Ralf Gommers a écrit : I am pleased to announce the availability of SciPy 0.10.0. Hi all, Thanks for this great job. I've run nosetests on my Mac (64-bit 10.7.2 build on EPD) which

[Numpy-discussion] numpy.int32 is not subclass of int, but numpy.int64 is

2011-11-14 Thread MACKEITH Andrew
Could someone explain this? An instance of numpy.int32 is not an instance of int or numpy.int. An instance of numpy.int64 is an instance of int and numpy.int. I don't know if it is a bug in my linux build. Andrew python26 Python 2.6.2 (r262:71600, Jul 8 2010, 11:49:56) [GCC 4.1.2 20070115

Re: [Numpy-discussion] numpy.int32 is not subclass of int, but numpy.int64 is

2011-11-14 Thread Robert Kern
On Mon, Nov 14, 2011 at 20:18, MACKEITH Andrew andrew.macke...@3ds.com wrote: Could someone explain this? An instance of numpy.int32 is not an instance of int or numpy.int. An instance of numpy.int64 is an instance of int and numpy.int. I don't know if it is a bug in my linux build. import

Re: [Numpy-discussion] Odd-looking long double on windows 32 bit

2011-11-14 Thread Matthew Brett
Hi, On Sun, Nov 13, 2011 at 5:03 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Nov 13, 2011 at 3:56 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sun, Nov 13, 2011 at 1:34 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Nov 13, 2011 at 2:25

Re: [Numpy-discussion] dedicated function for resize with averaging or rebin 2d arrays?

2011-11-14 Thread Andrea Zonca
thanks, On Mon, Nov 14, 2011 at 09:24, Chris.Barker chris.bar...@noaa.gov wrote: On 11/11/11 8:28 PM, Craig Yoshioka wrote: I once wrote a generic n-dimensional binning routine in C that I could find if anyone is interested in integrating it into numpy... it didn't do size increases though...

[Numpy-discussion] Using dtype=object

2011-11-14 Thread Nathan Faggian
Hi, I am interested in the use of numpy with native python objects, like so: In [91]: import collections In [92]: testContainer = collections.namedtuple('testContainer', 'att1 att2 att3') In [93]: test1 = testContainer(1, 2, 3) In [94]: test2 = testContainer(4, 5, 6) In [95]: test1 Out[95]:

Re: [Numpy-discussion] Odd-looking long double on windows 32 bit

2011-11-14 Thread David Cournapeau
On Mon, Nov 14, 2011 at 9:01 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sun, Nov 13, 2011 at 5:03 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Nov 13, 2011 at 3:56 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sun, Nov 13, 2011 at 1:34 PM,

Re: [Numpy-discussion] Odd-looking long double on windows 32 bit

2011-11-14 Thread Matthew Brett
Hi, On Mon, Nov 14, 2011 at 10:08 PM, David Cournapeau courn...@gmail.com wrote: On Mon, Nov 14, 2011 at 9:01 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Sun, Nov 13, 2011 at 5:03 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Nov 13, 2011 at 3:56 PM, Matthew