Re: [Numpy-discussion] atol in allclose

2006-11-28 Thread Charles R Harris
On 11/28/06, Robert Kern <[EMAIL PROTECTED]> wrote: Matthew Brett wrote: > Hi, > > Sorry to keep cluttering the list, but I was a bit surprised by this > behavior of allclose: > > In [25]:allclose([1.0], [1.0], rtol=0) > Out[25]:True > > In [26]:allclose([1.0], [1.0], rtol=0, atol=0) > Out[26]:F

Re: [Numpy-discussion] atol in allclose

2006-11-28 Thread Robert Kern
Matthew Brett wrote: > Hi, > > Sorry to keep cluttering the list, but I was a bit surprised by this > behavior of allclose: > > In [25]:allclose([1.0], [1.0], rtol=0) > Out[25]:True > > In [26]:allclose([1.0], [1.0], rtol=0, atol=0) > Out[26]:False > > The docstring seems to imply that atol wil

[Numpy-discussion] atol in allclose

2006-11-28 Thread Matthew Brett
Hi, Sorry to keep cluttering the list, but I was a bit surprised by this behavior of allclose: In [25]:allclose([1.0], [1.0], rtol=0) Out[25]:True In [26]:allclose([1.0], [1.0], rtol=0, atol=0) Out[26]:False The docstring seems to imply that atol will not be used in this comparison - or did I m

Re: [Numpy-discussion] dtype attributes of scalar types

2006-11-28 Thread Travis Oliphant
Matthew Brett wrote: >Hi, > >Would it be easy and / or sensible for - say - int32.itemsize to >return the same as dtype(int32).itemsize, rather than the 'itemsize' of 'numpy.generic' objects> that it returns at the moment? > > > You can do int32(0).itemsize. Getting the itemsize attribute to "d

Re: [Numpy-discussion] ScientificPython with NumPy

2006-11-28 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: >On 24.11.2006, at 19:04, [EMAIL PROTECTED] wrote: > > > >>Those who would like to test-drive ScientificPython with NumPy can do >>so now: just download version 2.7.1 from >> >> http://sourcesup.cru.fr/ >> >> > >Version 2.7.2 now, after the first bug fix: it wou

Re: [Numpy-discussion] can int and float exists in one array?(about difference in indexing Matlab matrix and Numpy array)

2006-11-28 Thread Travis Oliphant
Zhang Sam wrote: > Thanks for so many replies. > > In fact, I want to use several arrays to store the original data from > a practical project. In every arrays, two or three column will be > store the index. The main computation is still on matrices(float type) > which is built from the origi

Re: [Numpy-discussion] int32 twice in sctypes?

2006-11-28 Thread Travis Oliphant
Matthew Brett wrote: >Hi, > >I was a bit confused by this on 32 bit linux: > >In [30]:sctypes['int'] >Out[30]: >[, > , > , > , > ] > >Is it easy to explain the two entries for int32 here? I notice there >is only one int32 entry for the same test on my 64 bit system. > > > The mapping from c-typ

[Numpy-discussion] dtype attributes of scalar types

2006-11-28 Thread Matthew Brett
Hi, Would it be easy and / or sensible for - say - int32.itemsize to return the same as dtype(int32).itemsize, rather than the that it returns at the moment? Best, Matthew ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.sc

Re: [Numpy-discussion] int32 twice in sctypes?

2006-11-28 Thread Robert Kern
Matthew Brett wrote: > Hi, > > I was a bit confused by this on 32 bit linux: > > In [30]:sctypes['int'] > Out[30]: > [, > , > , > , > ] > > Is it easy to explain the two entries for int32 here? I notice there > is only one int32 entry for the same test on my 64 bit system. Hmm. When we con

[Numpy-discussion] int32 twice in sctypes?

2006-11-28 Thread Matthew Brett
Hi, I was a bit confused by this on 32 bit linux: In [30]:sctypes['int'] Out[30]: [, , , , ] Is it easy to explain the two entries for int32 here? I notice there is only one int32 entry for the same test on my 64 bit system. Thanks a lot, Matthew __

Re: [Numpy-discussion] numpy: azip ?

2006-11-28 Thread Torgil Svensson
or if you want to stack array with more dimensions concatenate((a[...,newaxis],b[...,newaxis]),axis=-1) On 11/28/06, Robert Kern <[EMAIL PROTECTED]> wrote: > Robert wrote: > > I often need a function to zip 2 (1D) arrays together to a 2D array - > > similar as python's zip() does. > > Found no

Re: [Numpy-discussion] numpy: azip ?

2006-11-28 Thread Robert Kern
Robert wrote: > I often need a function to zip 2 (1D) arrays together to a 2D array - similar > as python's zip() does. > Found no function in numpy to do that directly without thinking a lot. Or is > there one? > Otherwise such thing would be helpful in future numpy. column_stack() -- Robert

Re: [Numpy-discussion] idiom for deleting array elements

2006-11-28 Thread Martin Wiechert
Perfect, thanks! Martin On Tuesday 28 November 2006 17:31, Stefan van der Walt wrote: > On Tue, Nov 28, 2006 at 04:59:22PM +0100, Martin Wiechert wrote: > > I'm looking for an idiom to delete a sparse subset S (given as integer > > indices into A) of elements from a 1d array A. > > > > Something

Re: [Numpy-discussion] idiom for deleting array elements

2006-11-28 Thread Stefan van der Walt
On Tue, Nov 28, 2006 at 04:59:22PM +0100, Martin Wiechert wrote: > I'm looking for an idiom to delete a sparse subset S (given as integer > indices > into A) of elements from a 1d array A. > > Something like > > del L [I] > > if L is a list and I is a non-fancy index. > > My best idea is > >

[Numpy-discussion] idiom for deleting array elements

2006-11-28 Thread Martin Wiechert
Hi list, I'm looking for an idiom to delete a sparse subset S (given as integer indices into A) of elements from a 1d array A. Something like del L [I] if L is a list and I is a non-fancy index. My best idea is B = ones (A.shape, bool) B [S] = False A = A [B] Is there a better idiom (briefe

[Numpy-discussion] [Fwd: python-dev Summary for 2006-11-01 through 2006-11-15] - further discussion on buffer description

2006-11-28 Thread Colin J. Williams
Original Message Subject: python-dev Summary for 2006-11-01 through 2006-11-15 Date: Mon, 27 Nov 2006 04:52:10 + (GMT) From: [EMAIL PROTECTED] Newsgroups: gmane.comp.python.general python-dev Summary for 2006-11-01 through 2006-11-15

[Numpy-discussion] [Fwd: python-dev Summary for 2006-10-16 through 2006-10-31]

2006-11-28 Thread Colin J. Williams
Numpy readers will likely be interested in this excerpt. Colin W. Original Message Subject: python-dev Summary for 2006-10-16 through 2006-10-31 Date: Mon, 27 Nov 2006 04:47:23 + (GMT) From: [EMAIL PROTECTED] Reply-To: python-list@python.org Newsgroups: gmane.comp.python.ann

[Numpy-discussion] numpy: azip ?

2006-11-28 Thread Robert
I often need a function to zip 2 (1D) arrays together to a 2D array - similar as python's zip() does. Found no function in numpy to do that directly without thinking a lot. Or is there one? Otherwise such thing would be helpful in future numpy. I have this in my tools: def azip( *ll ): re

[Numpy-discussion] var and std

2006-11-28 Thread Aarre Laakso
Hello, I was wondering if someone could explain the rationale for changing .var() and .std() in release 1.0b1 from normalizing by n-1 (unbiased estimate from sample) to normalizing by n (population)? I have found the note that this change happened in the Release Notes http://www.scipy.org

[Numpy-discussion] recarray infos

2006-11-28 Thread Lionel Roubeyrie
Hi all, I'm interested by an array where I can call rows by their names and play with records, and recarray seems to be the solution. However, I can't find any complete documentation saying if recarray have the following behaviors: - stack datas : like numpy.array, is it possible to mak vstack,