Re: [Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray <=> numpy.array typemap to share?

2007-09-17 Thread David Cournapeau
Christopher Barker wrote: > David Cournapeau wrote: >> Christopher Barker wrote: >>> My real question is what compiler and library writers are doing -- has >>> anyone (OK, I guess MS and gcc are all I care about anyway) built >>> anything optimized for them? Are they going to dump them? Who knows

Re: [Numpy-discussion] Find contiguous sequences of booleans in arrays

2007-09-17 Thread Charles R Harris
Hi Kurdt, On 9/17/07, Kurdt Bane <[EMAIL PROTECTED]> wrote: > > Hi to all, > > I've got an 1-D array of bools and I'd like to find the length of the > first contiguous sequence of True values, starting from position [0] of the > array. > (That's equivalent to find the position of the first occurre

Re: [Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray <=> numpy.array typemap to share?

2007-09-17 Thread Christopher Barker
David Cournapeau wrote: > Christopher Barker wrote: >> My real question is what compiler and library writers are doing -- has >> anyone (OK, I guess MS and gcc are all I care about anyway) built >> anything optimized for them? Are they going to dump them? Who knows? > What do you mean by optimiza

Re: [Numpy-discussion] Segfault on wrong use of indexing

2007-09-17 Thread Arnar Flatberg
Thanks for the fast reply. Everything works fine with a repos checkout ('1.0.4.dev4045'). I was using the default package of Ubuntu Feisty, and must admit that I like to stay close to the package manager, especially with python stuff. With Gutsy on the doorstep, perhaps this not a serious issue (

Re: [Numpy-discussion] Segfault on wrong use of indexing

2007-09-17 Thread Travis E. Oliphant
Arnar Flatberg wrote: > However, when I tried to to insert a 1-dim array with a 'two-dim' > index things went wrong: > a[[0],:] = [2,2] > Segmentation fault > > I do not see this error in latest trunk of numpy (I suspect it's also not there in the latest release). > Am I

Re: [Numpy-discussion] Segfault on wrong use of indexing

2007-09-17 Thread Charles R Harris
Hi Arnar, On 9/17/07, Arnar Flatberg <[EMAIL PROTECTED]> wrote: > > Hi list > A pretty common use (for me) is to create arrays at the beginning of > my code and then fill in parts as I go along. Today, my code hit a > segmentation fault. The error was that an index-vector ,that usually > is a list

[Numpy-discussion] Segfault on wrong use of indexing

2007-09-17 Thread Arnar Flatberg
Hi list A pretty common use (for me) is to create arrays at the beginning of my code and then fill in parts as I go along. Today, my code hit a segmentation fault. The error was that an index-vector ,that usually is a list with several members, now contained only one member and I tried to insert a

Re: [Numpy-discussion] Find contiguous sequences of booleans in arrays

2007-09-17 Thread stefan
Hi Kurdt, On Mon, 17 Sep 2007 12:18:51 +0200, "Kurdt Bane" <[EMAIL PROTECTED]> wrote: > I've got an 1-D array of bools and I'd like to find the length of the > first > contiguous sequence of True values, starting from position [0] of the > array. One way would be: x = N.array([True,True,False,T

Re: [Numpy-discussion] ‎ Find contiguous sequences of booleans in arrays

2007-09-17 Thread David Cournapeau
Kurdt Bane wrote: > Hi to all, > > I've got an 1-D array of bools and I'd like to find the length of the > first contiguous sequence of True values, starting from position [0] > of the array. > (That's equivalent to find the position of the first occurrence of > False in the array). One possibil

[Numpy-discussion] ‎ Find contiguous sequences of booleans in arrays

2007-09-17 Thread Kurdt Bane
Hi to all, I've got an 1-D array of bools and I'd like to find the length of the first contiguous sequence of True values, starting from position [0] of the array. (That's equivalent to find the position of the first occurrence of False in the array). The problem is trivial, but I was wondering: w

[Numpy-discussion] A first proposal for dataset organization

2007-09-17 Thread David Cournapeau
Hi there, A few months ago, we started to discuss about various issues about dataset for numpy/scipy. In the context of my Summer Of Code for machine learning tools in python, I had the possibility to tackle concretely the issue. Before announcing a first alpha version of my work, I would l