Re: [Numpy-discussion] putmask/take ?

2006-09-22 Thread Stefan van der Walt
On Thu, Sep 21, 2006 at 08:35:02PM -0400, P GM wrote: Folks, I'm running into the following problem with putmask on take. import numpy x = N.arange(12.) m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1] i = N.nonzero (m)[0] w = N.array([-1, -2, -3, -4.]) x.putmask(w,m) You can also use

Re: [Numpy-discussion] Question about recarray

2006-09-22 Thread Lionel Roubeyrie
Le jeudi 21 septembre 2006 19:01, Travis Oliphant a écrit : Lionel Roubeyrie wrote: find any solution for that. I have tried with arrays of dtype=object, but I have problem when I want to compute min, max, ... with an error like: TypeError: function not supported for these types, and can't

Re: [Numpy-discussion] Putmask/take ?

2006-09-22 Thread Stefan van der Walt
On Fri, Sep 22, 2006 at 02:17:57AM -0500, Robert Kern wrote: Stefan van der Walt wrote: Hi P., On Thu, Sep 21, 2006 at 07:40:39PM -0400, PGM wrote: I'm running into the following problem with putmask on take. import numpy x = N.arange(12.) m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0,

[Numpy-discussion] reading large files

2006-09-22 Thread Svein-Erik.Hamran
I would like to read files 2Gbyte. From earlier posting I believed it should be possible with python 2.5. I am getting MemoryError when trying to read a file larger than 2Gb. I am using python2.5 and numpy1.0rc1. Any solution to the problem? SEH

Re: [Numpy-discussion] reading large files

2006-09-22 Thread Bill Baxter
Do you also have a 64-bit processor? Just checking since you didn't mention it. --bb On 9/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to read files 2Gbyte. From earlier posting I believed it should be possible with python 2.5. I am getting MemoryError when trying to

Re: [Numpy-discussion] general version of repmat?

2006-09-22 Thread Alan G Isaac
On Fri, 22 Sep 2006, Bill Baxter apparently wrote: Ok, here's my best shot at a generalized repmat: Sorry to always repeat this suggestion when it comes to repmat, but I think the whole approach is wrong. A repmat should be a separate object type, which behaves like the described matrix but

Re: [Numpy-discussion] general version of repmat?

2006-09-22 Thread Bill Baxter
On 9/22/06, Alan G Isaac [EMAIL PROTECTED] wrote: On Fri, 22 Sep 2006, Bill Baxter apparently wrote: Ok, here's my best shot at a generalized repmat: Sorry to always repeat this suggestion when it comes to repmat, but I think the whole approach is wrong. A repmat should be a separate

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

2006-09-22 Thread Tim Hochberg
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: David M. Cooke wrote:

Re: [Numpy-discussion] Putmask/take ?

2006-09-22 Thread Travis Oliphant
Stefan van der Walt wrote: On Fri, Sep 22, 2006 at 02:17:57AM -0500, Robert Kern wrote: According to the putmask docstring: a.putmask(values, mask) sets a.flat[n] = v[n] for each n where mask.flat[n] is true. v can be scalar. This would mean that 'w' is not of the right length.

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

2006-09-22 Thread Christopher Barker
Tim Hochberg wrote: It would probably be nice to expose the Kahan sum and maybe even the raw_kahan_sum somewhere. What about using it for .sum() by default? What is the speed hit anyway? In any case, having it available would be nice. I'm on the fence on using the array dtype for the

[Numpy-discussion] Always using scientific notation to print

2006-09-22 Thread Brian Granger
I want to be able to print an array in scientific notation. I have seen the set_printoptions() functions, but it doesn't really have an option for *always* using scientific notation. Can this be done? How? Thanks Brian -

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: David M. Cooke wrote: On Wed,

Re: [Numpy-discussion] bug in oldnumeric module

2006-09-22 Thread Robert Kern
Scott Ransom wrote: argmin is currently defined as using the argmax method! Please check out the latest source from SVN. I fixed this a few days ago. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to

Re: [Numpy-discussion] Always using scientific notation to print

2006-09-22 Thread Robert Kern
Brian Granger wrote: I want to be able to print an array in scientific notation. I have seen the set_printoptions() functions, but it doesn't really have an option for *always* using scientific notation. Can this be done? How? You can write a function that formats arrays how you like

Re: [Numpy-discussion] Always using scientific notation to print

2006-09-22 Thread Brian Granger
You can write a function that formats arrays how you like them and then tell ndarray to use it for __str__ or __repr__ using numpy.set_string_function(). That seems to be a little low level for most users. Would it be hard to have the possibility of specifying a format string? Brian

Re: [Numpy-discussion] Always using scientific notation to print

2006-09-22 Thread Travis Oliphant
Brian Granger wrote: You can write a function that formats arrays how you like them and then tell ndarray to use it for __str__ or __repr__ using numpy.set_string_function(). That seems to be a little low level for most users. Would it be hard to have the possibility of specifying a

Re: [Numpy-discussion] Putmask/take ?

2006-09-22 Thread Travis Oliphant
Travis Oliphant wrote: Yes, this does explain what you are seeing.It is the behavior of Numeric's putmask (where this method came from). It does seem counter-intuitive, and I'm not sure what to do with it. In some sense putmask should behave the same as x[m] = w. But, on the

Re: [Numpy-discussion] reading large files

2006-09-22 Thread Mike Ressler
On 9/22/06, Bill Baxter [EMAIL PROTECTED] wrote: Do you also have a 64-bit processor?Just checking since you didn't mention it.--bbOn 9/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to read files 2Gbyte. From earlier posting I believed it should be possible with python 2.5. I am

Re: [Numpy-discussion] Rationale for atleast_3d

2006-09-22 Thread Travis Oliphant
Bill Baxter wrote: 26 weeks, 4 days, 2 hours and 9 minutes ago, Zdeněk Hurák asked why atleast_3d acts the way it does: http://article.gmane.org/gmane.comp.python.numeric.general/4382/match=atleast+3d He doesn't seem to have gotten any answers. And now I'm wondering the same thing. Anyone have

Re: [Numpy-discussion] take behaviour has changed

2006-09-22 Thread Christian Kristukat
Travis Oliphant oliphant.travis at ieee.org writes: Christian Kristukat wrote: Bill Baxter wbaxter at gmail.com writes: Yep, check the release notes: http://www.scipy.org/ReleaseNotes/NumPy_1.0 search for 'take' on that page to find out what others have changed as well.