Re: [Numpy-discussion] memmap working?

2006-11-13 Thread Charles R Harris
On 11/13/06, Mathew Yeates <[EMAIL PROTECTED]> wrote: Not sure. When I run "top" I see the lineMemory: 6016M real, 2895M free, 4174M swap in use, 2427M swap freeIts the second number that drops like a rock. Plus, it never comes backuntil I quit the program. This is a great way to turn my machine in

Re: [Numpy-discussion] memmap working?

2006-11-13 Thread Charles R Harris
On 11/13/06, Mathew Yeates <[EMAIL PROTECTED]> wrote: I have a memory mapped array. When I try and assign data, my mem usagegoes through the roof.Is it cache memory or process memory? I think a memory mapped file will keep pages cached in memory until the space is needed so as to avoid unneeded io.

Re: [Numpy-discussion] why the difference between ipython and python shell?

2006-11-13 Thread Charles R Harris
On 11/13/06, Seweryn Kokot <[EMAIL PROTECTED]> wrote: Hello,Why ipython and python interactive shell give two different information?--- ipythonPython 2.4.4 (#2, Oct 20 2006, 00:23:25)Type "copyright", "credits" or "license" for more information. IPython 0.7.2 -- An enhanced Interactive Python.?

Re: [Numpy-discussion] array from list of lists

2006-11-12 Thread Charles R Harris
On 11/12/06, Erin Sheldon <[EMAIL PROTECTED]> wrote: Hi all -Thanks to everyone for the suggestions.I think map(tuple, list) is probably the most compact,but the list comprehension also works well.Because map() is proably going to disappear someday, I'll stick with the list comprehension.  array( [

Re: [Numpy-discussion] array from list of lists

2006-11-12 Thread Charles R Harris
On 11/12/06, Erin Sheldon <[EMAIL PROTECTED]> wrote: On 11/12/06, Erin Sheldon <[EMAIL PROTECTED]> wrote:> On 11/12/06, Pierre GM <[EMAIL PROTECTED]> wrote:> > > > You could try the fromarrays function of numpy.core.records> >> > >>> mydescriptor = {'names': (a','b','c','d'), 'formats':('f4', 'f4',

Re: [Numpy-discussion] x.min() depends on ordering

2006-11-11 Thread Charles R Harris
On 11/11/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Robert Kern wrote:> Keith Goodman wrote:>>> How about a nanmin() function? Already there.>> In [2]: nanmin?> Type:   function> Base Class: > Namespace:  Interactive> File:> /Library/Frameworks/Python.framework/Versions/2.5/li

Re: [Numpy-discussion] x.min() depends on ordering

2006-11-11 Thread Charles R Harris
On 11/11/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 11/11/06, Tim Hochberg <[EMAIL PROTECTED] > wrote: Robert Kern wrote: My preference would be to raise an error / warning when there is a nan in the array. Technically, there is no minimum value when a nan ispresent. I belie

Re: [Numpy-discussion] x.min() depends on ordering

2006-11-11 Thread Charles R Harris
On 11/11/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Robert Kern wrote: My preference would be to raise an error / warning when there is a nan in the array. Technically, there is no minimum value when a nan ispresent. I believe that this would be feasible be swapping the comparefrom 'a < b' to '!(a

Re: [Numpy-discussion] x.min() depends on ordering

2006-11-11 Thread Charles R Harris
On 11/11/06, Robert Kern <[EMAIL PROTECTED]> wrote: Keith Goodman wrote:> x.min() and x.max() depend on the ordering of the elements: x = M.matrix([[ M.nan, 2.0, 1.0]])>>> x.min()> nan x = M.matrix([[ 1.0, 2.0, M.nan]])>>> x.min()> 1.0>> If I were to try the latter in ipython, I'd assume,

Re: [Numpy-discussion] Assign NaN, get zero

2006-11-11 Thread Charles R Harris
On 11/11/06, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: On 11/11/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote:> NaN (or inf) is a floating point number, so seeing a zero in integer> representation seems correct: >> In [2]: int(N.nan)> Out[2]: 0L>Just to learn myself: Why int(N.nan) should be 0

Re: [Numpy-discussion] reading matrix from a file

2006-11-08 Thread Charles R Harris
On 11/8/06, Francesc Altet <[EMAIL PROTECTED]> wrote: A Dimecres 08 Novembre 2006 13:42, amit soni escrigué:> Hi,>   i have a file with following format:>  1 2>  3 9>  2 3>  4 4>I want to read it and then store the values into two matrices, s.t.>  A=[1 2;3 9]>  B=[2 3;4 4]>>   Can anyone tell

Re: [Numpy-discussion] matrix multiplication (newbie question)

2006-11-08 Thread Charles R Harris
On 11/8/06, Keith Goodman <[EMAIL PROTECTED]> wrote: On 11/8/06, izak marais <[EMAIL PROTECTED]> wrote:> Sorry if this is an obvious question, but what is the easiest way to> multiply matrices in numpy? Suppose I want to do A=B*C*D. The ' * ' operator > apparently does element wise multiplication,

Re: [Numpy-discussion] Style - was Re: numpy.repeat TypeError: array cannot be safely cast to required type

2006-11-06 Thread Charles R Harris
On 11/6/06, Colin J. Williams <[EMAIL PROTECTED]> wrote: Nobody has proposed using English yet - zeroes.It seemed a bridge too far.Chuck - Using Tomcat but need to do more? Need to support web services, security? Get stuff d

Re: [Numpy-discussion] Converting bool to float

2006-11-01 Thread Charles R Harris
On 11/1/06, Robert Kern <[EMAIL PROTECTED]> wrote: Tim Hochberg wrote:> Travis Oliphant wrote: However, whether or not float32 arrays operated with Python float scalars givefloat32 or float64 arrays is tangential to my question. Does anyone actuallythink that a Python float operated with a boolean

Re: [Numpy-discussion] dgesdd error

2006-11-01 Thread Charles R Harris
On 11/1/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 11/1/06, Fernando Perez < [EMAIL PROTECTED]> wrote: On 11/1/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:>> Apparently some dgesdd libraries don't actually compute the correct > value for the work-space si

Re: [Numpy-discussion] dgesdd error

2006-11-01 Thread Charles R Harris
On 11/1/06, Fernando Perez <[EMAIL PROTECTED]> wrote: On 11/1/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:>> Apparently some dgesdd libraries don't actually compute the correct> value for the work-space size if requested. >> This results in an ** ILLEGAL value and program termination from LAPACK.

Re: [Numpy-discussion] Reading records from file and sorting

2006-11-01 Thread Charles R Harris
On 11/1/06, George Sakkis <[EMAIL PROTECTED]> wrote: Albert Strasheim wrote:> Check the thread "Strange results when sorting array with fields" from> about a week back. Travis made some changes to sorting in the presence> of fields that should solve your problem, assuming your fields appear in > th

Re: [Numpy-discussion] Converting bool to float

2006-11-01 Thread Charles R Harris
On 11/1/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Travis Oliphant wrote:> Robert Kern wrote: Travis Oliphant wrote:>>> It looks like 1.0-x is doing the right thing.>>> >>> The problem is 1.0*x for matrices is going to float64.  For arrays it>>> returns float32 just like the 1.0-x>

Re: [Numpy-discussion] Converting bool to float

2006-11-01 Thread Charles R Harris
On 11/1/06, Keith Goodman <[EMAIL PROTECTED]> wrote: On 11/1/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:> It looks like 1.0-x is doing the right thing.>> The problem is 1.0*x for matrices is going to float64.  For arrays it > returns float32 just like the 1.0-x>> This can't be changed at this po

Re: [Numpy-discussion] Converting bool to float

2006-11-01 Thread Charles R Harris
On 11/1/06, Robert Kern <[EMAIL PROTECTED]> wrote: Travis Oliphant wrote:> It looks like 1.0-x is doing the right thing.>> The problem is 1.0*x for matrices is going to float64.  For arrays it> returns float32 just like the 1.0-xWhy is this the right thing? Python floats are float64. Same question

Re: [Numpy-discussion] [SciPy-user] Need more comments from scientific community on python-dev

2006-10-31 Thread Charles R Harris
On 10/31/06, John Hunter <[EMAIL PROTECTED]> wrote: > "Travis" == Travis Oliphant <[EMAIL PROTECTED]> writes:Travis> All of these seem to define their own objects which areTravis> basically just interpretations of chunks of memory.  At Travis> one time, we might have said "these sho

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Charles R Harris
On 10/30/06, Fernando Perez <[EMAIL PROTECTED]> wrote: On 10/23/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:> I've placed them in SVN (r3384):>> arraydescr_dealloc needs to do something like. >> if (self->fields == Py_None) {> print something> incref(self)> return;> }Here is some more

Re: [Numpy-discussion] Strange numpy.argmax behavior on object arrays in numpy 1.0.

2006-10-29 Thread Charles R Harris
On 10/29/06, Tom Denniston <[EMAIL PROTECTED]> wrote: Oh.  My mistake. I thought I had an array of 2 objects which were ints.  I actually had an array of one list of 2 ints.  It works properly if I construct the array properly.I think there is actually a bug here: In [61]: sort(array([3,2], dtype=o

Re: [Numpy-discussion] Strange numpy.argmax behavior on object arrays in numpy 1.0.

2006-10-29 Thread Charles R Harris
On 10/29/06, Tom Denniston <[EMAIL PROTECTED]> wrote: I recently upgraded to numpy 1.0 from 1.0b5.   I noticed that numpy.argmax behavior is very strange on object arrays.  See below:   (Pdb) numpy.__version__'1.0' (Pdb) numpy.argmax(numpy.array([2, 3], dtype=object))0(Pdb) numpy.argmax(numpy.array

Re: [Numpy-discussion] build errors Solaris x86 64 bit python2.5

2006-10-27 Thread Charles R Harris
On 10/26/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 10/26/06, Mathew Yeates < [EMAIL PROTECTED]> wrote: yes, I got around the problem from my previous posting "distutilsquestion". I added ld_args[:0] = ['-m64'] to line 209 ofpython2.5/distutils/unixcompiler.

Re: [Numpy-discussion] build errors Solaris x86 64 bit python2.5

2006-10-26 Thread Charles R Harris
On 10/26/06, Mathew Yeates <[EMAIL PROTECTED]> wrote: yes, I got around the problem from my previous posting "distutilsquestion". I added ld_args[:0] = ['-m64'] to line 209 ofpython2.5/distutils/unixcompiler.py. Lovely, yes I know.I now get an error "numpy/core/src/multiarraymodule.c:7230: error: `

Re: [Numpy-discussion] [ANN] NumPy 1.0 release

2006-10-26 Thread Charles R Harris
On 10/26/06, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: We are very pleased to announce the release of NumPy 1.0 available fordownload at http://www.numpy.orgCongratulations, Travis. Numpy was a needed unification and involved an enormous amount of work, most of it your own. Thanks for taking th

Re: [Numpy-discussion] Unit test error with numpy rc3

2006-10-26 Thread Charles R Harris
On 10/26/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Ted Horst wrote:> On Mac OS X tiger (10.4) ppc, long double has increased precision but> the same range as double (it really is 128 bits not 80, btw), so> e**1000 is inf, so this is not really an error. >>Thanks for the clarification.   Long-d

Re: [Numpy-discussion] Unit test error with numpy rc3

2006-10-26 Thread Charles R Harris
On 10/26/06, Ted Horst <[EMAIL PROTECTED]> wrote: On Mac OS X tiger (10.4) ppc, long double has increased precision butthe same range as double (it really is 128 bits not 80, btw), Looks like you are right: http://www.freestandards.org/spec/ELF/ppc64/PPC-elf64abi-1.9.html#PRECActually two doubles

Re: [Numpy-discussion] LPC, durbin-levinson, covariance, autocorrelation and lattice method?

2006-10-24 Thread Charles R Harris
On 10/24/06, Tobias Bengtsson <[EMAIL PROTECTED]> wrote: HiI wish to do some Linear Predictive Coding, using durbin-levinson,covariance, autocorrelation or lattice method algoritms.However I don't know anything on digital signal processing, neither am Ia star at math. I've ported http://www.phon.uc

Re: [Numpy-discussion] Unit test error with numpy rc3

2006-10-24 Thread Charles R Harris
On 10/24/06, Mark Hymers <[EMAIL PROTECTED]> wrote: On Mon, 23, Oct, 2006 at 11:50:27AM +0100, Mark Hymers spoke thus..> Hi,>> I've just done a Mac OS X PPC build of the SVN trunk and am getting this> failure too.> FAIL: Ticket #112 I've just been looking into this a bit further (though I may be he

Re: [Numpy-discussion] Random integers

2006-10-23 Thread Charles R Harris
On 10/23/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Albert Strasheim wrote:> Hello all>> I'm trying to generate random 32-bit integers. None of the following seem to> do the trick with NumPy 1.0.dev3383:>> In [32]: N.random.randint (-2**31, 2**31-1)> ValueError: low >= high>There should be a raw o

Re: [Numpy-discussion] Strange results when sorting array with fields

2006-10-22 Thread Charles R Harris
On 10/22/06, Albert Strasheim <[EMAIL PROTECTED]> wrote: Hello allI'm trying to sort an array with two fields, but I'm getting a result thatdoesn't seem to make sense.What I tried (first attempt): I have two 2-D arrays. I would like to sortone based on the sort of the other. I managed to do this wi

Re: [Numpy-discussion] some work on arpack

2006-10-21 Thread Charles R Harris
On 10/21/06, Bill Baxter <[EMAIL PROTECTED]> wrote: Here's something I've been wondering: is it ok to port Matlabfunctions over to python?  If so, then it's maybe an afternoon's workto get eigs working, given eigs.m and python Arpack wrappers.I'm 99% sure it would *not* be kosher to copy-paste thei

Re: [Numpy-discussion] Model and experiment fitting.

2006-10-21 Thread Charles R Harris
On 10/21/06, Sebastian Żurek <[EMAIL PROTECTED]> wrote: Robert Kern napisał(a):To make it clear.I've already solved the problem by a simple linear interpolation ofsimulated points within the narrow neighborhood of experimental datapoint. The simulation points are uniformly distributed along the X-r

Re: [Numpy-discussion] Installation problem

2006-10-19 Thread Charles R Harris
On 10/19/06, Tommy Grav <[EMAIL PROTECTED]> wrote: I am on a Mac OS X and are trying to install numpy/scipy/matplotlibActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based onPython 2.4.3 (#1, Apr  3 2006, 18:07:18) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwinType "help",

Re: [Numpy-discussion] Dimension reduction

2006-10-19 Thread Charles R Harris
On 10/19/06, David Huard <[EMAIL PROTECTED]> wrote: Hi, Is there an elegant way to reduce an array but conserve the reduced dimension ?Currently,>>> a = random.random((10,10,10))>>> a.sum(1).shape(10,10)but i'd like to keep (10,1,10) so I can do a/a.sum(1) directly. In [8]: a.sum(1)[:,newaxis,:].sh

Re: [Numpy-discussion] adding an attribute to an nd-array

2006-10-19 Thread Charles R Harris
On 10/19/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Stefan van der Walt wrote:>On Wed, Oct 18, 2006 at 09:17:49PM -0400, Pierre GM wrote:On Wednesday 18 October 2006 20:29, Stefan van der Walt wrote:>> I don't think the extra bytes for every ndarray object are worth it,given how easy it is

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

2006-10-18 Thread Charles R Harris
On 10/18/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>>> On 10/18/06, *Travis Oliphant* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote:>> Charles R Harris wrote:>> > Well, I knew that for numeric, but it was a good deal

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

2006-10-18 Thread Charles R Harris
On 10/18/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:> Well, I knew that for numeric, but it was a good deal less obvious in> combo with the order keyword.  For instance, contiguous could change> its meaning to match up with FORTRAN, so that FORTRAN=True a

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

2006-10-18 Thread Charles R Harris
On 10/18/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>> Could we make a few changes ;)>> For printing the flags I would suggest using C-Contiguous and> F-Contiguous so folks don't have to read the book. And at the c level > define alternat

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

2006-10-18 Thread Charles R Harris
On 10/18/06, George Nurser <[EMAIL PROTECTED]> wrote: > > None of the LaPack stuff seems to use the Fortran stuff, they just> > transpose and copy.You've got me worried here. I have assumed that when you start with ac-contiguous array, a, with say, a.shape = (m,n), if you use thetranspose as an arg

Re: [Numpy-discussion] scalar object bug or feature?

2006-10-18 Thread Charles R Harris
On 10/18/06, Alan G Isaac <[EMAIL PROTECTED]> wrote: On Wed, 18 Oct 2006, Keith Goodman apparently wrote: Here's a simpler (?) example:>>> x=numpy.random.rand(300,1)>0>>> x.sum()300>>> sum(x)array([44], dtype=int8)>>> x=numpy.random.rand(300)>0>>> sum(x) 300Alan IsaacHmmm, I think sum(x) and x.sum

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

2006-10-18 Thread Charles R Harris
Travis,On 10/18/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Tim Hochberg wrote:> One thing that may be confusing the issue is that, as I understand it,> FORTRAN and CONTIGUOUS together represent three states which I'll call> FORTRAN_ORDER, C_ORDER and DISCONTIGUOUS. Yep,  that's what they mean. 

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

2006-10-18 Thread Charles R Harris
On 10/18/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>>> On 10/18/06, *Tim Hochberg* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote:>> Charles R Harris wrote:>> [SNIP]> >> > I'm not talking abo

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

2006-10-18 Thread Charles R Harris
On 10/18/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:[SNIP]>> I'm not talking about the keyword in the ravel call, I'm talking about> the flag in a. The question is: do we *need* a fortran flag. I am> argueing not, because the only need is for fo

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

2006-10-18 Thread Charles R Harris
On 10/18/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: >> Currently, the key operation is reshape, which only needs to return a> view in fortran order and doesn't even need to mark the resulting> array as fortran order because, well, because it works just fine in > numpy as is, it just isn't conti

Re: [Numpy-discussion] questions regarding assignement and copy

2006-10-18 Thread Charles R Harris
On 10/18/06, David Cournapeau <[EMAIL PROTECTED]> wrote: Sven Schreiber wrote:>> Yes it's intended; as far as I understand the python/numpy syntax, <+>> is an operator, and that triggers assignment by copy (even if you do> something trivial as bar = +foo, you get a copy, if I'm not mistaken), >So b

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

2006-10-18 Thread Charles R Harris
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Stefan van der Walt wrote:> One last case, which confuses me still (probably because it is> 04:16am):Please continue to question.  All the code needs as much review as itcan get. I am really starting to wonder why we need an order keyword at a

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

2006-10-18 Thread Charles R Harris
On 10/17/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: 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

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

2006-10-18 Thread Charles R Harris
On 10/17/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 10/17/06, A. M. Archibald < [EMAIL PROTECTED]> wrote: On 17/10/06, Charles R Harris <[EMAIL PROTECTED]> wrote:>>> On 10/17/06, Travis Oliphant < [EMAIL PROTECTED] > wrote: Which doesn't seem to be t

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

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),ord

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),ord

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

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

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 h

[Numpy-discussion] Subversion

2006-10-16 Thread Charles R Harris
Subversion seems to be down. I get the following message:Authentication realm: mpi4py.scipy.orgmpi4py? And I am asked for my password, which doesn't work. Scipy.org also seems to be down. You folks having trouble there?Chuck ---

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

2006-10-16 Thread Charles R Harris
On 10/16/06, Travis Oliphant <[EMAIL PROTECTED]> 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 ju

[Numpy-discussion] What does Fortran order mean?

2006-10-16 Thread Charles R Harris
Travis,I note that>>> a = arange(6).reshape(2,3,order='F')>>> aarray([[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 wonder if changing the order can be used

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

2006-10-16 Thread Charles R Harris
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 in linalg could be replaced if array and asarray would do that ope

Re: [Numpy-discussion] rcond in polyfit

2006-10-15 Thread Charles R Harris
On 10/14/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: On 14/10/06, Charles R Harris <[EMAIL PROTECTED]> wrote: I don't get the impression that the warnings module is much tested; Ihad similar headaches.Turns out to be a rather simple bug (feature?) in warnings, where it

Re: [Numpy-discussion] rcond in polyfit

2006-10-14 Thread Charles R Harris
On 10/14/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>>> On 10/14/06, *A. M. Archibald* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote:[SNIP]>>> Hmmm, I wonder if we have a dictionary of precisions indexed by dtype> somewhere?Here

Re: [Numpy-discussion] rcond in polyfit

2006-10-14 Thread Charles R Harris
On 10/14/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: On 14/10/06, Charles R Harris <[EMAIL PROTECTED]> wrote:>>> On 10/13/06, A. M. Archibald <[EMAIL PROTECTED] > wrote:> > On 13/10/06, Tim Hochberg <[EMAIL PROTECTED]> wrote:> > > C

Re: [Numpy-discussion] rcond in polyfit

2006-10-14 Thread Charles R Harris
On 10/13/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: On 13/10/06, Tim Hochberg <[EMAIL PROTECTED]> wrote:> Charles R Harris wrote: > On the other hand if error handling is set to 'raise', then a> FloatingPointError is issued. Is a FloatingPointWarning in order to

Re: [Numpy-discussion] [SciPy-dev] NumPy/SciPy + MPI for Python

2006-10-14 Thread Charles R Harris
On 10/14/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: On 14/10/06, Gael Varoquaux <[EMAIL PROTECTED]> wrote:> On Sat, Oct 14, 2006 at 06:58:45AM -0600, Bill Spotz wrote: I agree. Moreover, being picked for such integration work would helpencourage people to converge on one MPI interface (for exa

Re: [Numpy-discussion] rcond in polyfit

2006-10-13 Thread Charles R Harris
On 10/13/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: On 12/10/06, Charles R Harris <[EMAIL PROTECTED]> wrote:> Hi all,>> I note that polyfit looks like it should work for single and double, real > and complex, polynomials. On the otherhand, the default rcond needs to&g

Re: [Numpy-discussion] Polyfit

2006-10-13 Thread Charles R Harris
On 10/12/06, Greg Willden <[EMAIL PROTECTED]> wrote: On 10/12/06, Charles R Harris <[EMAIL PROTECTED] > wrote: And here is the location of the problem in numpy/linalg/linalg.py :def lstsq(a, b, rcond=1.e-10): The 1e-10 is a bit conservative. On the other hand, I will note that the cond

Re: [Numpy-discussion] How to make sqrt(-1) be 1j

2006-10-12 Thread Charles R Harris
On 10/12/06, Bill Baxter <[EMAIL PROTECTED]> wrote: On 10/12/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote:> On Thu, Oct 12, 2006 at 08:58:21AM -0500, Greg Willden wrote:> > On 10/11/06, Bill Baxter < [EMAIL PROTECTED]> wrote:> I tried to explain the argument at>> http://www.scipy.org/NegativeS

[Numpy-discussion] rcond in polyfit

2006-10-12 Thread Charles R Harris
Hi all,I note that polyfit looks like it should work for single and double, real and complex, polynomials. On the otherhand, the default rcond needs to depend on the underlying precision. On the other, other hand, all the svd computations are done with dgelsd or zgelsd, i.e., double precision. Eve

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 10/12/06, Charles R Harris < [EMAIL PROTECTED]> wrote: On 10/12/06, Greg Willden < [EMAIL PROTECTED]> wrote: On 10/12/06, Charles R Harris <[EMAIL PROTECTED] > wrote: I'm guessing that the rcond number in the

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 10/12/06, Greg Willden < [EMAIL PROTECTED]> wrote: On 10/12/06, Charles R Harris <[EMAIL PROTECTED] > wrote: I'm guessing that the rcond number in the lstsq version (default 1e-10) is the difference. Generally t

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Greg Willden <[EMAIL PROTECTED]> wrote: On 10/12/06, Charles R Harris <[EMAIL PROTECTED] > wrote: I'm guessing that the rcond number in the lstsq version (default 1e-10) is the difference. Generally the lstsq version should work better than the MPL version because at

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Greg Willden <[EMAIL PROTECTED]> wrote: Hi All,I'm using numpy.polyfit and it is giving me some really strange results when evaluated near 0.  So I compared it with polyfit in matplotlib and the code and docstrings are nearly identical.  However the slight differences in the code make

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Charles R Harris
On 10/11/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Greg Willden wrote:> On 10/11/06, *Travis Oliphant* <[EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote: >> Stefan van der Walt wrote:> >Further, if I understand correctly, changing sqrt and power to give> >the right answer by default will

Re: [Numpy-discussion] round

2006-10-11 Thread Charles R Harris
On 10/11/06, Greg Willden <[EMAIL PROTECTED]> wrote: Hi All,I've read discussions in the archives about how round() "rounds to even" and how that is supposedly better.But what I haven't been able to find is "What do I use if I want the regular old round that you learn in school?" Perhaps you could

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Charles R Harris
On 10/11/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Hi all,Py3K is undergoing active development.  This gives us an opportunity todiscuss more significant changes to the language that might improve theexperience of NumPy users.We should form a list and start commenting on the py3k mailing lists

Re: [Numpy-discussion] asmatrix and asarray exception

2006-10-11 Thread Charles R Harris
On 10/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote: On 10/11/06, Keith Goodman <[EMAIL PROTECTED]> wrote:> This works:>> >> M.asmatrix(['a', 'b', None])> matrix([[a, b, None]], dtype=object) >> But this doesn't:>> >> M.asmatrix(['a', 'b', None, 'c'])> TypeError: expected a readable buffer object>

Re: [Numpy-discussion] naive RNG question

2006-10-11 Thread Charles R Harris
On 10/11/06, Alan G Isaac <[EMAIL PROTECTED]> wrote: Python's MT documentation exmphasize the period of theMT19937 algorithm but discusses not at all the seed size.The numpy documentation contains no commentary (I believe).Speaking from a position of utter RNG ignorance, seed size seems really impo

Re: [Numpy-discussion] PIL with numpy support!

2006-10-10 Thread Charles R Harris
On 10/10/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 10/10/06, Christopher Barker < [EMAIL PROTECTED]> wrote: Hi all:Fredrik Lundh wrote:> A little later that planned, but PIL 1.1.6 beta 2 is now available from SVN:>>   http://svn.effbot.python-hosting.com/tags/pil-

Re: [Numpy-discussion] PIL with numpy support!

2006-10-10 Thread Charles R Harris
On 10/10/06, Christopher Barker <[EMAIL PROTECTED]> wrote: Hi all:Fredrik Lundh wrote:> A little later that planned, but PIL 1.1.6 beta 2 is now available from SVN:>>  http://svn.effbot.python-hosting.com/tags/pil-1.1.6b2/ >> A tarball will appear on effbot.org shortly:>>  http://effbot.org

Re: [Numpy-discussion] can this be made faster?

2006-10-09 Thread Charles R Harris
On 10/9/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: > > > > c contains arbitray floats.> > > > essentially it is to compute class totals> > > > as in total[class[i]] += value[i]> > This seems like a rather common operation - I know I've needed it on > > at least two occasions - is it worth creat

Re: [Numpy-discussion] can this be made faster?

2006-10-09 Thread Charles R Harris
On 10/9/06, A. M. Archibald <[EMAIL PROTECTED]> wrote: On 09/10/06, Robert Kern <[EMAIL PROTECTED]> wrote:> Daniel Mahler wrote:> > In my case all a, b, c are large with b and c being orders of> > magnitude lareger than a. > > b is known to contain only, but potentially any, a-indexes,  reapeated>

Re: [Numpy-discussion] tensor product

2006-10-09 Thread Charles R Harris
On 10/9/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>>> On 10/9/06, *Tim Hochberg* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote:>> >> Is this not the same things as numpy.multiply.outer(a, b)? (as> opposed>

Re: [Numpy-discussion] ide for python/numpy/scipy/mpl, development ?

2006-10-09 Thread Charles R Harris
On 10/9/06, Pierre GM <[EMAIL PROTECTED] > wrote: On Monday 09 October 2006 04:20, Bill Baxter wrote:> If you don't mind going commercial, then the WingIDE has been working> very well for me.Did anybody mention Eclipse+pydev ? I've been a regular user for the last few months, and I'm quite happy ab

Re: [Numpy-discussion] tensor product

2006-10-09 Thread Charles R Harris
On 10/9/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Is this not the same things as numpy.multiply.outer(a, b)? (as opposed to outer(a, b), which appears to pretend that everything is a vector --I'm not sure what the point of that is).Hmmm, yes, multiply.outer does do that. I thought that outer was

Re: [Numpy-discussion] tensor product

2006-10-08 Thread Charles R Harris
Hi Nadav,On 10/8/06, Nadav Horesh <[EMAIL PROTECTED]> wrote: There is a "tensortdot" function in numpy1.0rc1 The tensordot is not the same thing as a tensor product. What I want is the following: def tensor(a, b) :     """Tensor product of a and b         """     a = asarray(a)     b = asarray(b)

[Numpy-discussion] tensor product

2006-10-07 Thread Charles R Harris
Hmmm,I notice that there is no longer a tensor product. As it was the only one of the outer, kron bunch that I really wanted, l miss it. In fact, I always thought outer should act like the tensor product for the other binary operators too. Anyway, mind if I put it back? Chuck --

Re: [Numpy-discussion] ide for python/numpy/scipy/mpl development ?

2006-10-06 Thread Charles R Harris
On 10/6/06, Robert Kern <[EMAIL PROTECTED] > wrote: Eric Emsellem wrote:> Hi,>> I am looking for an IDE to develop python programs  and I am not sure> what to take.> The two critical items for me are 1/ a good debugger (simple and> efficient) 2/ something simple to manage the files. >> I would also

Re: [Numpy-discussion] Segfault with 64-bit, ACML, Python 2.5

2006-09-26 Thread Charles R Harris
On 9/26/06, Nickolas V Fotopoulos <[EMAIL PROTECTED]> wrote: Dear numpy pros,I have a problem and I don't know whether it's from local setup intricacies(64-bit Opteron with ACML and Python 2.5) or something in numpy (fresh SVNcheckout).  I observe the following: Any idea what might be wrong?  One o

Re: [Numpy-discussion] numpy 1.0rc1 has problems finding blas

2006-09-26 Thread Charles R Harris
On 9/26/06, Hanno Klemm <[EMAIL PROTECTED]> wrote: Hello,I try to build numpy 1.0rc1 with blas and lapack installed in anotherplace than /usr/lib. I compiled blas and lapack according to theinstructions on the scipy webpage and installed them under /scratch/python2.4/lib.I set the environment varia

Re: [Numpy-discussion] Shift or rotate command?

2006-09-24 Thread Charles R Harris
On 9/24/06, Bill Baxter <[EMAIL PROTECTED]> wrote: Howdy Angus,Yeh, that does seem like a hole in the API.  Travis added a rollaxis()but there's still no simple way to roll the elements themselves.I took a look at numpy.fft.fftshift, which is a function that has to do a similar thing.  It does it b

Re: [Numpy-discussion] please change mean to use dtype=float

2006-09-22 Thread Charles R Harris
On 9/22/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Sebastian Haase wrote:> On Thursday 21 September 2006 15:28, Tim Hochberg wrote:>>> David M. Cooke wrote:> On Thu, 21 Sep 2006 11:34:42 -0700>> Tim Hochberg < [EMAIL PROTECTED]> wrote:>>> Tim Hochberg wrote:> Robert Kern wrote:

Re: [Numpy-discussion] please change mean to use dtype=float

2006-09-22 Thread Charles R Harris
Hi,On 9/22/06, Tim Hochberg <[EMAIL PROTECTED]> wrote: Tim Hochberg wrote:> David M. Cooke wrote:>>> On Thu, 21 Sep 2006 11:34:42 -0700>> Tim Hochberg <[EMAIL PROTECTED]> wrote:>> >>> Tim Hochberg wrote:>> Robert Kern wrote:> David M. Cooke wrote: >>>

Re: [Numpy-discussion] Tests and code documentation

2006-09-21 Thread Charles R Harris
Hi, On 9/21/06, Robert Kern <[EMAIL PROTECTED]> wrote: Steve Lianoglou wrote:> So .. I guess I'm wondering why we want to break from the standard?We don't as far as Python code goes. The code that Chuck added Doxygen-stylecomments to was C code. I presume he was simply answering Sebastian's questio

Re: [Numpy-discussion] Tests and code documentation

2006-09-21 Thread Charles R Harris
On 9/21/06, Sebastian Haase <[EMAIL PROTECTED]> wrote: On Thursday 21 September 2006 09:05, Charles R Harris wrote:> Travis,>> A few questions.>> 1) I can't find any systematic code testing units, although there seem to> be tests for regressions and such. Is there

[Numpy-discussion] Tests and code documentation

2006-09-21 Thread Charles R Harris
Travis,A few questions.1) I can't find any systematic code testing units, although there seem to be tests for regressions and such. Is there a place we should be putting such tests?2) Any plans for code documentation? I documented some of my stuff with doxygen markups and wonder if we should includ

Re: [Numpy-discussion] 1.0rc1 doesn't seem to work on AMD64

2006-09-21 Thread Charles R Harris
On 9/21/06, Peter Bienstman <[EMAIL PROTECTED]> wrote: Hi,I just installed rc1 on an AMD64 machine. but I get this error message whentrying to import it:Python 2.4.3 (#1, Sep 21 2006, 13:06:42)[GCC 4.1.1 (Gentoo 4.1.1)] on linux2Type "help", "copyright", "credits" or "license" for more information.

  1   2   3   >