[Numpy-discussion] summing an array

2011-08-18 Thread Chris Withers
Hi All, Hopefully a simple newbie question, if I have an array such as : array([0, 1, 2, 3, 4]) ...what's the best way to cummulatively sum it so that I end up with: array([0, 1, 3, 6, 10]) How would I do this both in-place and to create a new array? cheers, Chris -- Simplistix - Content

Re: [Numpy-discussion] summing an array

2011-08-18 Thread Skipper Seabold
On Thu, Aug 18, 2011 at 10:19 AM, Chris Withers ch...@simplistix.co.uk wrote: Hi All, Hopefully a simple newbie question, if I have an array such as : array([0, 1, 2, 3, 4]) ...what's the best way to cummulatively sum it so that I end up with: array([0, 1, 3, 6, 10]) How would I do this

Re: [Numpy-discussion] summing an array

2011-08-18 Thread Bob Dowling
On 18/08/11 15:19, Chris Withers wrote: Hopefully a simple newbie question, if I have an array such as : array([0, 1, 2, 3, 4]) ...what's the best way to cummulatively sum it so that I end up with: array([0, 1, 3, 6, 10]) How would I do this both in-place and to create a new array? a

[Numpy-discussion] NA masks for NumPy are ready to test

2011-08-18 Thread Mark Wiebe
It's taken a lot of changes to get the NA mask support to its current point, but the code ready for some testing now. You can read the work-in-progress release notes here: https://github.com/m-paradox/numpy/blob/missingdata/doc/release/2.0.0-notes.rst To try it out, check out the missingdata

[Numpy-discussion] dtype and shape for 1.6.1 seems broken?

2011-08-18 Thread Robert Love
This works under 1.5.1 and 1.6.0 but gives me errors in 1.6.1 import numpy as np def main(): printnumpy version: + np.__version__ zdt = np.dtype([('et','i4'),('r','f8',3)]) zdata = np.loadtxt('zdum.txt', zdt) In 1.6.1 I get this error: ValueError: setting an array element with a

Re: [Numpy-discussion] dtype and shape for 1.6.1 seems broken?

2011-08-18 Thread Mark Wiebe
This could be related to ticket #1936: http://projects.scipy.org/numpy/ticket/1936 for which there's a pull request against master here: https://github.com/numpy/numpy/pull/140 -Mark On Thu, Aug 18, 2011 at 7:24 PM, Robert Love rblove_li...@comcast.netwrote: This works under 1.5.1 and

Re: [Numpy-discussion] dtype and shape for 1.6.1 seems broken?

2011-08-18 Thread Christoph Gohlke
On 8/18/2011 7:24 PM, Robert Love wrote: This works under 1.5.1 and 1.6.0 but gives me errors in 1.6.1 import numpy as np def main(): printnumpy version: + np.__version__ zdt = np.dtype([('et','i4'),('r','f8',3)]) zdata = np.loadtxt('zdum.txt', zdt) In 1.6.1 I get this error:

Re: [Numpy-discussion] dtype and shape for 1.6.1 seems broken?

2011-08-18 Thread David Warde-Farley
On 2011-08-18, at 10:24 PM, Robert Love wrote: In 1.6.1 I get this error: ValueError: setting an array element with a sequence. Is this a known problem? You'll have to post a traceback if we're to figure out what the problem is. A few lines of zdum.txt would also be nice. Suffice it to

Re: [Numpy-discussion] longlong format error with Python = 2.6 in scalartypes.c

2011-08-18 Thread Mark Wiebe
On Thu, Aug 4, 2011 at 4:08 PM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: Hi, commits c15a807e and c135371e (thus most immediately addressed to Mark, but I am sending this to the list hoping for more insight on the issue) introduce a test failure with Python 2.5+2.6 on Mac:

Re: [Numpy-discussion] dtype and shape for 1.6.1 seems broken?

2011-08-18 Thread Charles R Harris
On Thu, Aug 18, 2011 at 9:45 PM, Christoph Gohlke cgoh...@uci.edu wrote: On 8/18/2011 7:24 PM, Robert Love wrote: This works under 1.5.1 and 1.6.0 but gives me errors in 1.6.1 import numpy as np def main(): printnumpy version: + np.__version__ zdt =