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 install

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. I ask because I

[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

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 buffer

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 also

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 making a copy, but

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, 4, 5]]) Shouldn't that be 3x2? Or maybe

[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,

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:snip The long-standing behavior is to raise the error on possible-lossconversion and so my opinion is that we should continue with that behavior.But, on the other hand, it looks like numarray went

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 pass

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. Have numpy

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

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] 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

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 -Travis

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-definedarray_repr function.The one that gets over-written on import.Thatmakes sense.And is definitely do-able. Please file a ticket.Can you point me to how to file a

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 coefficient

[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] 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

[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] 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. Please

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 Tomcat

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]]) This is a

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 changed.

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] mailto:[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]]) This one still

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] mailto:[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]]) This one still

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] mailto:[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]]) This one still

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 Fortran ravel? I