Re: [Numpy-discussion] Testing numpy without doing an installation?

2006-10-17 Thread Francesc Altet
A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: > On 10/13/06, Francesc Altet <[EMAIL PROTECTED]> wrote: > > Is it possible to test a numpy version directly from the source > > directory without having to install it? > > I usually do: > > $ python setup.py build > $ python setup.py

Re: [Numpy-discussion] Testing numpy without doing an installation?

2006-10-17 Thread Stefan van der Walt
On Tue, Oct 17, 2006 at 10:03:03AM +0200, Francesc Altet wrote: > A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: > > On 10/13/06, Francesc Altet <[EMAIL PROTECTED]> wrote: > > > Is it possible to test a numpy version directly from the source > > > directory without having to instal

Re: [Numpy-discussion] What does Fortran order mean?

2006-10-17 Thread Stefan van der Walt
On Mon, Oct 16, 2006 at 02:20:04PM -0600, Charles R Harris wrote: > Travis, > > I note that > > >>> a = arange(6).reshape(2,3,order='F') > >>> a > array([[0, 1, 2], >[3, 4, 5]]) > > Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making a copy, > but flat, flatten, and tost

Re: [Numpy-discussion] Testing numpy without doing an installation?

2006-10-17 Thread pearu
On Tue, 17 Oct 2006, Stefan van der Walt wrote: > On Tue, Oct 17, 2006 at 10:03:03AM +0200, Francesc Altet wrote: > > A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: > > > On 10/13/06, Francesc Altet <[EMAIL PROTECTED]> wrote: > > > > Is it possible to test a numpy version directl

Re: [Numpy-discussion] Subversion

2006-10-17 Thread Jeff Strunk
This was a problem in Virtualmin when I created the mpi4py virtual server. I reverted the change, and everything seems to work now. Sorry for the inconvenience, Jeff On Monday 16 October 2006 10:14 pm, Robert Kern wrote: > Charles R Harris wrote: > > Subversion seems to be down. I get the follow

[Numpy-discussion] hyper complex numbers

2006-10-17 Thread gary thompson
what is the best and most efficiednt way to deal with hyper complex numbers in numpy/scipye.g.for a 1d array we have a complex number containing real and imaginary pairs... conceptually we have((r,i),(r,i)...(r,i)) however, for a hypercomplex number in 2d we have quartets of numbers e.g.((rr,ir,ir,

Re: [Numpy-discussion] What does Fortran order mean?

2006-10-17 Thread Travis Oliphant
Charles R Harris wrote: > Travis, > > I note that > > >>> a = arange(6).reshape(2,3,order='F') > >>> a > array([[0, 1, 2], >[3, 4, 5]]) > > Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making a > copy, but flat, flatten, and tostring all show the elements in 'C' > order.

[Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Francesc Altet
Hi, I'm looking for an easy way to access the data area of the numpy scalars no matter its type. I've seen that numpy/arrayscalars.h define a structure for each scalar type, so I'd guess that it will not be possible to find a general way for accessing the data buffer for each type. So, I've de

Re: [Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Travis Oliphant
Francesc Altet wrote: >Hi, > >I'm looking for an easy way to access the data area of the numpy scalars no >matter its type. I've seen that numpy/arrayscalars.h define a structure for >each scalar type, so I'd guess that it will not be possible to find a general >way for accessing the data buff

Re: [Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Francesc Altet
A Dimarts 17 Octubre 2006 18:22, Travis Oliphant va escriure: > >2.- Fetch the buffer in scalartype.data and use the buffer protocol in > > order to access the pointer to data in memory. However, I lack experience > > in buffer protocol, so suggestions for achieving this are welcome. > > This will

Re: [Numpy-discussion] What does Fortran order mean?

2006-10-17 Thread Stefan van der Walt
On Tue, Oct 17, 2006 at 10:01:51AM -0600, Travis Oliphant wrote: > Charles R Harris wrote: > > > Travis, > > > > I note that > > > > >>> a = arange(6).reshape(2,3,order='F') > > >>> a > > array([[0, 1, 2], > >[3, 4, 5]]) > > > > Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is

Re: [Numpy-discussion] What does Fortran order mean?

2006-10-17 Thread Travis Oliphant
Stefan van der Walt wrote: >On Tue, Oct 17, 2006 at 10:01:51AM -0600, Travis Oliphant wrote: > > >>Charles R Harris wrote: >> >> >> >>>Travis, >>> >>>I note that >>> >>> >>> >>a = arange(6).reshape(2,3,order='F') >>a >> >> >>>array([[0, 1, 2], >>> [3,

Re: [Numpy-discussion] Why doesn't array(a, dtype=single, copy=0) downcast a double array.

2006-10-17 Thread Travis Oliphant
Travis Oliphant wrote: >Charles R Harris wrote: > > >>It seems to me that since the behaviour when copy=0 is to make a copy >>only if necessary, it should find it necessary and make the downcast. >>After all, array(a, dtype=single, copy=1) does just that without >>complaint. Some common code

[Numpy-discussion] array repr

2006-10-17 Thread Andrew MacKeith
I would like to use the built-in array_repr in numpy, because I need a fast repr that does not contain new line characters. I see no way of doing this without editing the code in numeric.py, and I hate to edit other people's libraries. from numpy import array causes numeric.py to be executed, whic

Re: [Numpy-discussion] Why doesn't array(a, dtype=single, copy=0) downcast a double array.

2006-10-17 Thread Charles R Harris
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Travis Oliphant wrote:>Charles R Harris wrote:> >The long-standing behavior is to raise the error on possible-loss>conversion and so my opinion is that we should continue with that behavior.>>>But, on the other hand, it looks like numarray we

Re: [Numpy-discussion] array repr

2006-10-17 Thread Travis Oliphant
Andrew MacKeith wrote: >I would like to use the built-in array_repr in numpy, because >I need a fast repr that does not contain new line characters. >I see no way of doing this without editing the code in numeric.py, >and I hate to edit other people's libraries. > >from numpy import array >causes

Re: [Numpy-discussion] What does Fortran order mean?

2006-10-17 Thread Lisandro Dalcin
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > The require command can help you get the right kind of > array for that purpose. > BTW, Travis In [1]: numpy.__version__ Out[1]: '1.0rc2' In [2]: print numpy.require.__doc__ None What is this 'requirements' argument? What should user pas

Re: [Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Lisandro Dalcin
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Or you can use the Python C-API > > const char *buffer; > Py_ssize_t buflen; > > PyObject_AsReadBuffer(scalar, (const void **)&buffer, &buflen) > > to retrieve a pointer to the data in buffer and the size of the data in > buflen. > Travis.

Re: [Numpy-discussion] array repr

2006-10-17 Thread Andrew MacKeith
Travis Oliphant wrote: >Andrew MacKeith wrote: > > > >>I would like to use the built-in array_repr in numpy, because >>I need a fast repr that does not contain new line characters. >>I see no way of doing this without editing the code in numeric.py, >>and I hate to edit other people's libraries.

Re: [Numpy-discussion] Casting

2006-10-17 Thread Charles R Harris
On 10/12/06, Cristian Codorean <[EMAIL PROTECTED]> wrote: Hello list,   I got some old code that uses Scientific and Numeric. Recently, these two packages were updated to the latest versions together with python and my code started failing. The first major problem I have is when downcasting. Code t

[Numpy-discussion] matlab, filter function

2006-10-17 Thread Kenny Ortmann
just looking for some help, most of the time you guys are good with matlab code, i am trying to use the filter function under this setting y = filter(b,a,X) filters the data in vector X with the filter described by numerator coefficient vector b and denominator coefficient vector a. If a(1) is

Re: [Numpy-discussion] dtype always copies

2006-10-17 Thread Charles R Harris
On 10/13/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: Hi all,I've noticed that 'astype' always forces a copy.  Is thisbehaviour intended?  It seems to conflict with 'asarray', thattries to avoid a copy.For example, when wrapping code in ctypes, the following snippet would have been useful:def

Re: [Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Travis Oliphant
Lisandro Dalcin wrote: >On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > >>Or you can use the Python C-API >> >>const char *buffer; >>Py_ssize_t buflen; >> >>PyObject_AsReadBuffer(scalar, (const void **)&buffer, &buflen) >> >>to retrieve a pointer to the data in buffer and the size of

Re: [Numpy-discussion] array repr

2006-10-17 Thread Travis Oliphant
Ah!, I get it. You want to be able to reset to the C-defined array_repr function. The one that gets over-written on import.That makes sense. And is definitely do-able. Please file a ticket. -Travis - Using Tomc

Re: [Numpy-discussion] array repr

2006-10-17 Thread Andrew MacKeith
Travis Oliphant wrote: >Ah!, I get it. You want to be able to reset to the C-defined >array_repr function. The one that gets over-written on import.That >makes sense. And is definitely do-able. > >Please file a ticket. > > Can you point me to how to file a ticket. Thanks Andrew > > >

[Numpy-discussion] recent ubuntu package

2006-10-17 Thread Sven Schreiber
Hi, as suggested on the website I use the kindly provided pre-built (unofficial) ubuntu debs. Recently there is a new one available with version numbe 1.0+~dev3336-0ads1. Apart from the slightly strange +~ thing in there, it very much seems to be based on trac changeset 3336, which is somewhere be

Re: [Numpy-discussion] array repr

2006-10-17 Thread Charles R Harris
On 10/17/06, Andrew MacKeith <[EMAIL PROTECTED]> wrote: Travis Oliphant wrote:>Ah!,  I get it.  You want to be able to reset to the C-defined>array_repr function.  The one that gets over-written on import.That>makes sense.  And is definitely do-able. >>Please file a ticket.>>Can you point me to

[Numpy-discussion] histogram complete makeover

2006-10-17 Thread David Huard
Hi all, I'd like to poll the list to see what people want from numpy.histogram(), since I'm currently writing a contender.My main complaints with the current version are:1. upper outliers are stored in the last bin, while lower outliers are not counted at all, 2. cannot use weights.The new histogra

Re: [Numpy-discussion] matlab, filter function

2006-10-17 Thread Travis Oliphant
Kenny Ortmann wrote: >just looking for some help, most of the time you guys are good with matlab >code, i am trying to use the filter function under this setting > >y = filter(b,a,X) filters the data in vector X with the filter described by >numerator coefficient vector b and denominator coeffic

[Numpy-discussion] Significant letter. You must to read.

2006-10-17 Thread Molly Driscoll
Please read it. Today is the exact day to buy that stock. Please check that note attentively. Here you will find the intimate news about GDKI. Please Read this news. Goldmark Cipher Established Hip Hop Creator Sean Combs A.K.A. Puff Daddy Wednesday this month 18, 11:40 am ET NEW YORK & LOS

[Numpy-discussion] Question about indexing arrays with boolean arrays

2006-10-17 Thread Daniel Arbuckle
Why does a[b1, b2] not mean the same thing as a[b1][:, b2], when "a" is an array and "b1" and "b2" are appropriately sized arrays of booleans? Thanks - Using Tomcat but need to do more? Need to support web services, security?

Re: [Numpy-discussion] A reimplementation of MaskedArray

2006-10-17 Thread Michael Sorich
On 10/17/06, Pierre GM <[EMAIL PROTECTED]> wrote: > On Monday 16 October 2006 22:08, Michael Sorich wrote: > > Does this new MA class allow masking of rearray like arrays? > > Excellent question! Which is to say, I have no idea... I don't use > recordarray, so I didn't think about testing them. > >

[Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Stefan van der Walt
Hi all, Some of you may have seen the interesting thread on Fortran-ordering earlier. I thought it might be fun to set up a short quiz which tests your knowledge on the topic. If you're up for the challenge, take a look at http://mentat.za.net/numpy/quiz I won't be held liable for any emotiona

[Numpy-discussion] 1.0rc2 strange repeat behavior

2006-10-17 Thread Mike Rovner
Hi, I got strange discrepance between 2.4+0.9.8 and 2.5+1.0rc2: model_lib_pool %0 !5019$ python2.5 Python 2.5 (r25:51908, Oct 17 2006, 16:16:21) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-14)] on linux2 Type "help", "copyright", "credits" or "license" for more information. f>>> from numpy import *

Re: [Numpy-discussion] histogram complete makeover

2006-10-17 Thread Neal Becker
David Huard wrote: > Hi all, > > I'd like to poll the list to see what people want from numpy.histogram(), > since I'm currently writing a contender. > > My main complaints with the current version are: > 1. upper outliers are stored in the last bin, while lower outliers are not > counted at all

Re: [Numpy-discussion] array repr

2006-10-17 Thread Andrew.MacKeith
Charles R Harris wrote: On 10/17/06, Andrew MacKeith <[EMAIL PROTECTED]> wrote: Travis Oliphant wrote: >Ah!,  I get it.  You want to be able to reset to the C-defined >array_repr function.  The one that gets over-written on import.That >makes sense.  And is definitely do-able.

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Lisandro Dalcin
I was surprised by this In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F') Out[14]: array([[1, 5], [4, 3], [2, 6]]) In [15]: array([1,2,3,4,5,6]).reshape((3,2),order='F') Out[15]: array([[1, 2], [3, 4], [5, 6]]) On 10/17/06, Stefan van der Walt <[EMAIL PROTEC

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Bill Baxter
I think the answer to #3 is wrong. >From 1.0rc2 I get: >>> array([1,2,3,4,5,6],order='C').reshape((2,3),order='F') array([[1, 2, 3], [4, 5, 6]]) But the quiz wants me to answer something different. --bb - Using Tomca

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Travis Oliphant
Lisandro Dalcin wrote: > I was surprised by this > > In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F') > Out[14]: > array([[1, 5], >[4, 3], >[2, 6]]) > > In [15]: array([1,2,3,4,5,6]).reshape((3,2),order='F') > Out[15]: > array([[1, 2], >[3, 4], >[5, 6]]) >

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Stefan van der Walt
On Wed, Oct 18, 2006 at 10:30:26AM +0900, Bill Baxter wrote: > I think the answer to #3 is wrong. > > >From 1.0rc2 I get: > >>> array([1,2,3,4,5,6],order='C').reshape((2,3),order='F') > array([[1, 2, 3], >[4, 5, 6]]) > > But the quiz wants me to answer something different. This recently

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Charles R Harris
On 10/17/06, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: I was surprised by thisIn [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F')Out[14]:array([[1, 5],   [4, 3],   [2, 6]])This one still looks wrong. In [15]: array([1,2,3,4,5,6]).reshape((3,2),order='F')Out[15]:array([[1, 2],  

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Travis Oliphant
Stefan van der Walt wrote: > Hi all, > > Some of you may have seen the interesting thread on Fortran-ordering > earlier. I thought it might be fun to set up a short quiz which tests > your knowledge on the topic. > > If you're up for the challenge, take a look at > > http://mentat.za.net/numpy/qui

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Travis Oliphant
Charles R Harris wrote: > > > On 10/17/06, *Lisandro Dalcin* <[EMAIL PROTECTED] > > wrote: > > I was surprised by this > > In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F') > Out[14]: > array([[1, 5], >[4, 3], >[2, 6]]) > >

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Travis Oliphant
Charles R Harris wrote: > > > On 10/17/06, *Lisandro Dalcin* <[EMAIL PROTECTED] > > wrote: > > I was surprised by this > > In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F') > Out[14]: > array([[1, 5], >[4, 3], >[2, 6]]) > >

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Charles R Harris
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>>> On 10/17/06, *Lisandro Dalcin* <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote: >> I was surprised by this>> In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F')> Out[14]:> array([[1, 5],>

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Stefan van der Walt
On Tue, Oct 17, 2006 at 07:53:11PM -0600, Travis Oliphant wrote: > Stefan van der Walt wrote: > > Hi all, > > > > Some of you may have seen the interesting thread on Fortran-ordering > > earlier. I thought it might be fun to set up a short quiz which tests > > your knowledge on the topic. > > > >

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Charles R Harris
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>>> On 10/17/06, *Lisandro Dalcin* <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote: >> I was surprised by this>> In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F')> Out[14]:> array([[1, 5],>

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Charles R Harris
On 10/17/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 10/17/06, Travis Oliphant < [EMAIL PROTECTED]> wrote: Charles R Harris wrote:>>> On 10/17/06, *Lisandro Dalcin* <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote: >> I was surprised by this>> In [14]: array([[1,2,3],[4,5,6]]).reshape((

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread A. M. Archibald
On 17/10/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > Thus, reshape does the equivalent of a Fortran ravel to [1,4,2,5,3,6] > > and then a Fortran-order based fill of an empty (3,2) array: giving you > > the result. > > Why a Fo