Re: [Numpy-discussion] sorting and nans, timings.

2009-07-23 Thread David Cournapeau
Charles R Harris wrote: > Hi All, > > I changed the sort routines to sort nans to the end and got some > timings. Sorting 10 random doubles 100 times yields: > >current nan version > quicksort 1.17 sec1.29 sec > mergesort 1.37 sec1.36 sec > heapsort

Re: [Numpy-discussion] sorting and nans, timings.

2009-07-23 Thread David Cournapeau
David Cournapeau wrote: > Charles R Harris wrote: > >> Hi All, >> >> I changed the sort routines to sort nans to the end and got some >> timings. Sorting 10 random doubles 100 times yields: >> >>current nan version >> quicksort 1.17 sec1.29 sec >> mergesort

Re: [Numpy-discussion] Comparing the precision of dtypes?

2009-07-23 Thread Hans Meine
On Wednesday 22 July 2009 17:16:31 Ralf Gommers wrote: > Examples where min/max probably does not do what you want, and > find_common_type does: > > In [49]: max(float, float32) > Out[49]: > In [50]: find_common_type([], [float, float32]) > Out[50]: dtype('float64') I don't understand the followi

Re: [Numpy-discussion] Comparing the precision of dtypes?

2009-07-23 Thread Citi, Luca
Hi Hans, You can follow this thread on approximately the same topic http://news.gmane.org/find-root.php?group=gmane.comp.python.numeric.general&article=31551 It should have been fixed in http://projects.scipy.org/numpy/changeset/7133 Best, Luca ___ NumP

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-23 Thread Scott Sinclair
> 2009/7/22 Pierre GM : > You could try scipy.stats.scoreatpercentile, > scipy.stats.mstats.plottingposition or scipy.stats.mstats.mquantiles, > which will all approximate quantiles of your distribution. It seems that mquantiles doesn't do what you'd expect when the limit keyword argument is speci

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-23 Thread Pierre GM
On Jul 23, 2009, at 6:07 AM, Scott Sinclair wrote: >> 2009/7/22 Pierre GM : >> You could try scipy.stats.scoreatpercentile, >> scipy.stats.mstats.plottingposition or scipy.stats.mstats.mquantiles, >> which will all approximate quantiles of your distribution. > > It seems that mquantiles doesn't d

[Numpy-discussion] Not enough storage for memmap on 32 bit Win XP for accumulated file size above approx. 1 GB

2009-07-23 Thread Kim Hansen
OS. Win XP SP3, 32 bits Python: 2.5.4 Numpy: 1.3.0 I have am having some major problems converting a 750 MB recarray into a 850 MB recarray To save RAM I would like to use a read-only and a writeable memap for the two recarrays during the conversion. So I do something like: import os from stat

Re: [Numpy-discussion] Getting 95%/99% margin of ndarray

2009-07-23 Thread Scott Sinclair
> 2009/7/23 Pierre GM : > > On Jul 23, 2009, at 6:07 AM, Scott Sinclair wrote: > >>> 2009/7/22 Pierre GM : >>> You could try scipy.stats.scoreatpercentile, >>> scipy.stats.mstats.plottingposition or scipy.stats.mstats.mquantiles, >>> which will all approximate quantiles of your distribution. >> >>

[Numpy-discussion] pdf for multivariate normal function?

2009-07-23 Thread per freem
hi all, i'm trying to find the function for the pdf of a multivariate normal pdf. i know that the function "multivariate_normal" can be used to sample from the multivariate normal distribution, but i just want to get the pdf for a given vector of means and a covariance matrix. is there a function

Re: [Numpy-discussion] Not enough storage for memmap on 32 bit Win XP for accumulated file size above approx. 1 GB

2009-07-23 Thread Charles R Harris
On Thu, Jul 23, 2009 at 5:36 AM, Kim Hansen wrote: > OS. Win XP SP3, 32 bits > Python: 2.5.4 > Numpy: 1.3.0 > > I have am having some major problems converting a 750 MB recarray into > a 850 MB recarray > > To save RAM I would like to use a read-only and a writeable memap for > the two recarrays

[Numpy-discussion] String to integer array of ASCII values

2009-07-23 Thread Peter
Dear all, I've looked over some of the documentation for creating an array, e.g. http://docs.scipy.org/doc/numpy/user/basics.creation.html#arrays-creation http://docs.scipy.org/doc/numpy/reference/routines.array-creation.html However, I don't see an example quite like what I want to do. I want to

Re: [Numpy-discussion] Not enough storage for memmap on 32 bit Win XP for accumulated file size above approx. 1 GB

2009-07-23 Thread Kim Hansen
2009/7/23 Charles R Harris : > > >> >> Is it due to the 32 bit OS I am using? > > It could be. IIRC, 32 bit windows gives user programs 2 GB of addressable > memory, so your files need to fit in that space even if the data is on disk. > You aren't using that much memory but you are close and it cou

[Numpy-discussion] Numpy/Scipy and the Python African Tour

2009-07-23 Thread Emmanuelle Gouillart
Dear users of Numpy and Scipy, here is an informal report on the last event of the Python African Tour, which took place in Dakar (Senegal) on July 6-10th. It might interest only a fraction of the lists, so I apologize for the spamming. What is the Python African Tour? ---

Re: [Numpy-discussion] Not enough storage for memmap on 32 bit Win XP for accumulated file size above approx. 1 GB

2009-07-23 Thread Charles R Harris
On Thu, Jul 23, 2009 at 7:48 AM, Kim Hansen wrote: > 2009/7/23 Charles R Harris : > > > > > >> > >> Is it due to the 32 bit OS I am using? > > > > It could be. IIRC, 32 bit windows gives user programs 2 GB of addressable > > memory, so your files need to fit in that space even if the data is on >

Re: [Numpy-discussion] pdf for multivariate normal function?

2009-07-23 Thread Charles R Harris
On Thu, Jul 23, 2009 at 7:14 AM, per freem wrote: > hi all, > > i'm trying to find the function for the pdf of a multivariate normal pdf. i > know that the function "multivariate_normal" can be used to sample from the > multivariate normal distribution, but i just want to get the pdf for a given

Re: [Numpy-discussion] String to integer array of ASCII values

2009-07-23 Thread Charles R Harris
On Thu, Jul 23, 2009 at 7:18 AM, Peter < numpy-discuss...@maubp.freeserve.co.uk> wrote: > Dear all, > > I've looked over some of the documentation for creating an array, e.g. > http://docs.scipy.org/doc/numpy/user/basics.creation.html#arrays-creation > http://docs.scipy.org/doc/numpy/reference/rou

Re: [Numpy-discussion] pdf for multivariate normal function?

2009-07-23 Thread Andrew Jaffe
Hi, Charles R Harris wrote: > > On Thu, Jul 23, 2009 at 7:14 AM, per freem > wrote: > > i'm trying to find the function for the pdf of a multivariate normal > pdf. i know that the function "multivariate_normal" can be used to > sample from the multivariate

Re: [Numpy-discussion] String to integer array of ASCII values

2009-07-23 Thread Peter
On Thu, Jul 23, 2009 at 3:54 PM, Charles R Harris wrote: > > Would something like > > In [2]: array("ABCDEF", 'c').view(uint8) > Out[2]: array([65, 66, 67, 68, 69, 70], dtype=uint8) > > work for you? Yes, that also looks good. I guess I have a couple of options to benchmark now :) Thank you, Pet

Re: [Numpy-discussion] String to integer array of ASCII values

2009-07-23 Thread Charles R Harris
On Thu, Jul 23, 2009 at 9:50 AM, Peter < numpy-discuss...@maubp.freeserve.co.uk> wrote: > On Thu, Jul 23, 2009 at 3:54 PM, Charles R > Harris wrote: > > > > Would something like > > > > In [2]: array("ABCDEF", 'c').view(uint8) > > Out[2]: array([65, 66, 67, 68, 69, 70], dtype=uint8) > > > > work f

Re: [Numpy-discussion] String to integer array of ASCII values

2009-07-23 Thread Peter
On Thu, Jul 23, 2009 at 5:07 PM, Charles R Harris wrote: > > One more: > >  In [1]: fromstring("ABCDEF", dtype=uint8) > Out[1]: array([65, 66, 67, 68, 69, 70], dtype=uint8) > > Chuck I should have guessed that one. Why isn't numpy.fromstring listed with the other entries in the "From existing data

Re: [Numpy-discussion] suggestion for generalizing numpy functions

2009-07-23 Thread Darren Dale
On Tue, Jul 21, 2009 at 10:11 AM, Darren Dale wrote: > On Tue, Jul 21, 2009 at 7:44 AM, Darren Dale wrote: >> 2009/7/20 Stéfan van der Walt : >>> Hi Chuck >>> >>> 2009/7/17 Charles R Harris : PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos) Return value: Borrowed reference. Ret

Re: [Numpy-discussion] String to integer array of ASCII values

2009-07-23 Thread David Goldsmith
--- On Thu, 7/23/09, Peter wrote: > I should have guessed that one. Why isn't numpy.fromstring > listed with the > other entries in the "From existing data" section here? Maybe because it got listed in the I/O category and wasn't to be double listed? > http://docs.scipy.org/doc/numpy/reference

[Numpy-discussion] numpy subclass

2009-07-23 Thread Jacopo
I am facing the opposite problem described here: http://docs.scipy.org/doc/numpy/user/basics.subclassing.html In short, I want to create a class Dummy, inherited from np.ndarray, which returns a plain array whenever an instance is sliced or viewed. I cannot figure out how. I would really apprecia

Re: [Numpy-discussion] numpy subclass

2009-07-23 Thread Pierre GM
On Jul 23, 2009, at 1:13 PM, Jacopo wrote: > > In short, I want to create a class Dummy, inherited from np.ndarray, > which > returns a plain array whenever an instance is sliced or viewed. I > cannot figure > out how. Easy enough for slices: class Dummy(np.ndarray): def __new__

Re: [Numpy-discussion] numpy subclass

2009-07-23 Thread Jacopo
Pierre GM gmail.com> writes: > > > On Jul 23, 2009, at 1:13 PM, Jacopo wrote: > > > > In short, I want to create a class Dummy, inherited from np.ndarray, > > which > > returns a plain array whenever an instance is sliced or viewed. I > > cannot figure > > out how. > > Easy enough for slic

Re: [Numpy-discussion] numpy subclass

2009-07-23 Thread Matthew Brett
Hi, > In short, I want to create a class Dummy, inherited from np.ndarray, which > returns a plain array whenever an instance is sliced or viewed. I cannot > figure > out how. > class Dummy(np.ndarray): > > def __new__(cls, array): >   obj=array.view(cls) >   return obj > def __array_finalize__(

Re: [Numpy-discussion] Odd nosetest error in test_umath.py

2009-07-23 Thread Charles R Harris
On Thu, Jul 23, 2009 at 4:56 PM, Matthew Brett wrote: > Hi, > > I just got an email about a broken buildbot build. Looking at the > logs, I see this: > > == > FAIL: Test bug in reduceat with structured arrays copied for speed. >

Re: [Numpy-discussion] Odd nosetest error in test_umath.py

2009-07-23 Thread Matthew Brett
Hi, > It's been there ever since Travis added the test, but it is sporadic. It's > probably a reference counting error somewhere but no one has tracked it down > yet. There is a ticket open on it. As a demonstration that this is not fully predictable; here's me copying the test file, running it o

[Numpy-discussion] Odd nosetest error in test_umath.py

2009-07-23 Thread Matthew Brett
Hi, I just got an email about a broken buildbot build. Looking at the logs, I see this: == FAIL: Test bug in reduceat with structured arrays copied for speed. -

Re: [Numpy-discussion] pdf for multivariate normal function?

2009-07-23 Thread David Cournapeau
per freem wrote: > hi all, > > i'm trying to find the function for the pdf of a multivariate normal > pdf. i know that the function "multivariate_normal" can be used to > sample from the multivariate normal distribution, but i just want to > get the pdf for a given vector of means and a covariance

Re: [Numpy-discussion] String to integer array of ASCII values

2009-07-23 Thread Scott Sinclair
> 2009/7/23 David Goldsmith : > > --- On Thu, 7/23/09, Peter wrote: > >> I should have guessed that one. Why isn't numpy.fromstring >> listed with the >> other entries in the "From existing data" section here? > >> This looks like a simple improvement to the >> documentation... > > Yup, that it is