Re: [Numpy-discussion] long(a) vs a.__long__() for scalar arrays

2010-02-10 Thread Pauli Virtanen
ti, 2010-02-09 kello 23:28 -0700, Charles R Harris kirjoitti: [clip] > I'm curious if np.long the same as long? np.long is long I'm not sure if this was always so, since ticket #99's test cases try to check that np.long works properly. Pauli

Re: [Numpy-discussion] Emulate left outer join?

2010-02-10 Thread David Carmean
On Tue, Feb 09, 2010 at 04:49:30PM -0600, John Hunter wrote: > On Tue, Feb 9, 2010 at 4:43 PM, Fernando Perez wrote: > > On Tue, Feb 9, 2010 at 5:02 PM, Robert Kern wrote: > >> > >> numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter') > >> > > > > And if that isn't sufficient, John h

Re: [Numpy-discussion] wired error message in scipy.sparse.eigen function: Segmentation fault

2010-02-10 Thread David Cournapeau
On Sat, Feb 6, 2010 at 9:25 AM, Jankins wrote: > This problem keeps bothering me for days. > If you need more sample to test it, I got one more. I tested it this > morning. And the "segmentation  fault" happened at a specific place. > I guess, finally, I have to refer to the original eigenvalue al

Re: [Numpy-discussion] Emulate left outer join?

2010-02-10 Thread John Hunter
On Tue, Feb 9, 2010 at 7:53 PM, Pierre GM wrote: > On Feb 9, 2010, at 8:16 PM, John Hunter wrote: >> and have "totxt", "tocsv". etc... from rec2txt, rec2csv, etc...   I >> think the functionality of mlab.rec_summarize and rec_groupby is very >> useful, but the interface is a bit clunky and could

[Numpy-discussion] Syntax equivalent for np.array()

2010-02-10 Thread Gökhan Sever
Hi, Simple question: I[4]: a = np.arange(10) I[5]: b = np.array(5) I[8]: a*b.cumsum() O[8]: array([ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45]) I[9]: np.array(a*b).cumsum() O[9]: array([ 0, 5, 15, 30, 50, 75, 105, 140, 180, 225]) Is there a syntactic equivalent for the I[9] --for instance

Re: [Numpy-discussion] Syntax equivalent for np.array()

2010-02-10 Thread Angus McMorland
On 10 February 2010 11:02, Gökhan Sever wrote: > Hi, > > Simple question: > > I[4]: a = np.arange(10) > > I[5]: b = np.array(5) > > I[8]: a*b.cumsum() > O[8]: array([ 0,  5, 10, 15, 20, 25, 30, 35, 40, 45]) > > I[9]: np.array(a*b).cumsum() > O[9]: array([  0,   5,  15,  30,  50,  75, 105, 140, 180

Re: [Numpy-discussion] Emulate left outer join?

2010-02-10 Thread John Hunter
On Wed, Feb 10, 2010 at 8:54 AM, John Hunter wrote: > On Tue, Feb 9, 2010 at 7:53 PM, Pierre GM wrote: >> On Feb 9, 2010, at 8:16 PM, John Hunter wrote: > >>> and have "totxt", "tocsv". etc... from rec2txt, rec2csv, etc...   I >>> think the functionality of mlab.rec_summarize and rec_groupby is v

Re: [Numpy-discussion] Syntax equivalent for np.array()

2010-02-10 Thread Gökhan Sever
On Wed, Feb 10, 2010 at 10:06 AM, Angus McMorland wrote: > On 10 February 2010 11:02, Gökhan Sever wrote: > > Hi, > > > > Simple question: > > > > I[4]: a = np.arange(10) > > > > I[5]: b = np.array(5) > > > > I[8]: a*b.cumsum() > > O[8]: array([ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45]) > > > > I[

Re: [Numpy-discussion] Syntax equivalent for np.array()

2010-02-10 Thread Gökhan Sever
On Wed, Feb 10, 2010 at 10:12 AM, Gökhan Sever wrote: > > > On Wed, Feb 10, 2010 at 10:06 AM, Angus McMorland wrote: > >> On 10 February 2010 11:02, Gökhan Sever wrote: >> > Hi, >> > >> > Simple question: >> > >> > I[4]: a = np.arange(10) >> > >> > I[5]: b = np.array(5) >> > >> > I[8]: a*b.cumsum

Re: [Numpy-discussion] Syntax equivalent for np.array()

2010-02-10 Thread Keith Goodman
On Wed, Feb 10, 2010 at 8:24 AM, Gökhan Sever wrote: > Self-correction: > > It works correctly in IPython-dev as well. > > And further in Python 2.6.2: > p = () p > () type(p) > type((a*b)) > > > ( ) doesn't only works as a tuple operator. It also has its original > parenthe

Re: [Numpy-discussion] Syntax equivalent for np.array()

2010-02-10 Thread Gael Varoquaux
On Wed, Feb 10, 2010 at 08:33:11AM -0800, Keith Goodman wrote: > I think this is the rule: When empty it is a tuple; when containing > one item it is parentheses unless there is a comma. > >> p = (9) > >> type(p) > > >> p = (9,) > >> type(p) > The coma is the tuple operator. For instance

Re: [Numpy-discussion] Syntax equivalent for np.array()

2010-02-10 Thread josef . pktd
On Wed, Feb 10, 2010 at 11:24 AM, Gökhan Sever wrote: > > > On Wed, Feb 10, 2010 at 10:12 AM, Gökhan Sever > wrote: >> >> >> On Wed, Feb 10, 2010 at 10:06 AM, Angus McMorland >> wrote: >>> >>> On 10 February 2010 11:02, Gökhan Sever wrote: >>> > Hi, >>> > >>> > Simple question: >>> > >>> > I[4]

Re: [Numpy-discussion] Emulate left outer join?

2010-02-10 Thread Pierre GM
On Feb 10, 2010, at 11:10 AM, John Hunter wrote: > On Wed, Feb 10, 2010 at 8:54 AM, John Hunter wrote: >> On Tue, Feb 9, 2010 at 7:53 PM, Pierre GM wrote: >>> On Feb 9, 2010, at 8:16 PM, John Hunter wrote: >> and have "totxt", "tocsv". etc... from rec2txt, rec2csv, etc... I think the

[Numpy-discussion] loadtxt and genfromtxt

2010-02-10 Thread Jonathan Stickel
I am new to python/numpy/scipy and new to this list. I recently migrated over from using Octave and am very impressed so far! Recently I needed to load data from a text file and quickly found numpy's "loadtxt" function. However, there were missing data values, which loadtxt does not handle. Aft

Re: [Numpy-discussion] Scalar-ndarray arguments passed to not_equal

2010-02-10 Thread Friedrich Romstedt
I wonder why there is no response on my e-mail dating back to Feb 4. Is there nobody interested in it, is somebody working on it, or did it simply did not come through? I changed the recipient now to "Discussion of Numerical Python", hth ... Sorry when there is double posting now, it's not intend

Re: [Numpy-discussion] Scalar-ndarray arguments passed to not_equal

2010-02-10 Thread Keith Goodman
On Wed, Feb 10, 2010 at 10:57 AM, Friedrich Romstedt wrote: > I wonder why there is no response on my e-mail dating back to Feb 4. > Is there nobody interested in it, is somebody working on it, or did it > simply did not come through?  I changed the recipient now to > "Discussion of Numerical Pyth

Re: [Numpy-discussion] Scalar-ndarray arguments passed to not_equal

2010-02-10 Thread Alan G Isaac
On 2/10/2010 1:57 PM, Friedrich Romstedt wrote: > I wonder why there is no response on my e-mail dating back to Feb 4. > Is there nobody interested in it, is somebody working on it, or did it > simply did not come through? I'm going to guess it is because your actual question is at the very end of

Re: [Numpy-discussion] Scalar-ndarray arguments passed to not_equal

2010-02-10 Thread josef . pktd
On Wed, Feb 10, 2010 at 2:41 PM, Alan G Isaac wrote: > On 2/10/2010 1:57 PM, Friedrich Romstedt wrote: >> I wonder why there is no response on my e-mail dating back to Feb 4. >> Is there nobody interested in it, is somebody working on it, or did it >> simply did not come through? > > I'm going to

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Travis Oliphant
On Feb 8, 2010, at 4:08 PM, Darren Dale wrote: On Mon, Feb 8, 2010 at 5:05 PM, Darren Dale wrote: On Mon, Feb 8, 2010 at 5:05 PM, Jarrod Millman wrote: On Mon, Feb 8, 2010 at 1:57 PM, Charles R Harris wrote: Should the release containing the datetime/hasobject changes be called a) 1.

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Pierre GM
On Feb 10, 2010, at 3:31 PM, Travis Oliphant wrote: > > > The list I proposed for deciding the issue was the group I am aware of having > written significant code for NumPy.I suppose I un-intentionally left off > Pierre GM who contributed masked array support. We need some way of > mak

[Numpy-discussion] lib.recfunctions: which version? (was Re: Emulate left outer join?)

2010-02-10 Thread David Carmean
On Tue, Feb 09, 2010 at 04:49:30PM -0600, John Hunter wrote: > On Tue, Feb 9, 2010 at 4:43 PM, Fernando Perez wrote: > > On Tue, Feb 9, 2010 at 5:02 PM, Robert Kern wrote: > >> > >> numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter') > >> Sorry, guys, maybe this is my python-newbne

Re: [Numpy-discussion] lib.recfunctions: which version? (was Re: Emulate left outer join?)

2010-02-10 Thread Robert Kern
On Wed, Feb 10, 2010 at 15:57, David Carmean wrote: > On Tue, Feb 09, 2010 at 04:49:30PM -0600, John Hunter wrote: >> On Tue, Feb 9, 2010 at 4:43 PM, Fernando Perez wrote: >> > On Tue, Feb 9, 2010 at 5:02 PM, Robert Kern wrote: >> >> >> >> numpy.lib.recfunctions.join_by(key, r1, r2, jointype='le

Re: [Numpy-discussion] lib.recfunctions: which version? (was Re: Emulate left outer join?)

2010-02-10 Thread Pierre GM
On Feb 10, 2010, at 4:57 PM, David Carmean wrote: > > I still can't figure out what to import/how to get to numpy.lib.recfunctions. > > Maybe I don't yet understand the scipy/numpy/matplotlib package structure? Nope, that's not a standard one: >>> import numpy.lib.recfunctions as recf

Re: [Numpy-discussion] lib.recfunctions: which version? (was Re: Emulate left outer join?)

2010-02-10 Thread David Carmean
On Wed, Feb 10, 2010 at 04:12:27PM -0600, Robert Kern wrote: > > I still can't figure out what to import/how to get to > > numpy.lib.recfunctions. > > Maybe I don't yet understand the scipy/numpy/matplotlib package structure? > > from numpy.lib import recfunctions > > recfunctions.join_by(...)

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Darren Dale
On Wed, Feb 10, 2010 at 3:31 PM, Travis Oliphant wrote: > On Feb 8, 2010, at 4:08 PM, Darren Dale wrote: >> I definitely should have counted to 100 before sending that. It wasn't >> helpful and I apologize. > > I actually found this quite funny.    I need to apologize if my previous > email sounde

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Matthew Brett
Hi, >   NumPy decisions in the past have been made by me and other people who are > writing the code.   I think we have tried pretty hard to listen to all > points of view before doing anything.    I think there are many examples of > this.   I hope this previous history alleviates some concern th

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Christopher Barker
Matthew Brett wrote: > Only a small point, but, while I completely agree that the version > number is a bike-shed, that's what I meant when I said it... > I don't think that's true of the ABI breakage, well, yes and no. On the one hand, it's very big deal -- not the color of the shed. On the o

Re: [Numpy-discussion] loadtxt and genfromtxt

2010-02-10 Thread Ralf Gommers
On Thu, Feb 11, 2010 at 1:36 AM, Jonathan Stickel wrote: > I am new to python/numpy/scipy and new to this list. I recently > migrated over from using Octave and am very impressed so far! > > Recently I needed to load data from a text file and quickly found > numpy's "loadtxt" function. However,

[Numpy-discussion] Shape of join_by result is not what I expected

2010-02-10 Thread David Carmean
On Tue, Feb 09, 2010 at 04:02:48PM -0600, Robert Kern wrote: > numpy.lib.recfunctions.join_by(key, r1, r2, jointype='leftouter') > * The output is sorted along the key. > * A temporary array is formed by dropping the fields not in the key for > the > two arrays and concatenating th

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread David Cournapeau
On Thu, Feb 11, 2010 at 5:31 AM, Travis Oliphant wrote: > Christopher's argument that having a NumPy 2.0 sets expectations for keeping > 1.4 and 2.0 is a strong one in my mind.   The policy of coupling ABI and > version numbers makes less and less sense to me as I hear the concerns of > keeping t

Re: [Numpy-discussion] Shape of join_by result is not what I expected

2010-02-10 Thread Pierre GM
On Feb 10, 2010, at 7:26 PM, David Carmean wrote: >> > > Got this to "work", but now it's revealed my lack of understanding of the > shape > of arrays; I'd hoped that the results would look like (be the same shape > as?) > the column_stack results. You're misunderstanding what structured ar

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Charles R Harris
On Wed, Feb 10, 2010 at 6:22 PM, David Cournapeau wrote: > On Thu, Feb 11, 2010 at 5:31 AM, Travis Oliphant > wrote: > > > Christopher's argument that having a NumPy 2.0 sets expectations for > keeping > > 1.4 and 2.0 is a strong one in my mind. The policy of coupling ABI and > > version number

[Numpy-discussion] Determine if two arrays share references

2010-02-10 Thread Keith Goodman
Here are two arrays that share references: >> x = np.array([1,2,3]) >> y = x[1:] and here are two that don't: >> x = np.array([1,2,3]) >> y = x[1:].copy() If I didn't know how the arrays were constructed, how would I determine if any elements in the two arrays share reference? (I'm not sure of

Re: [Numpy-discussion] Determine if two arrays share references

2010-02-10 Thread Robert Kern
On Wed, Feb 10, 2010 at 21:41, Keith Goodman wrote: > Here are two arrays that share references: > >>> x = np.array([1,2,3]) >>> y = x[1:] > > and here are two that don't: > >>> x = np.array([1,2,3]) >>> y = x[1:].copy() > > If I didn't know how the arrays were constructed, how would I > determine

Re: [Numpy-discussion] Determine if two arrays share references

2010-02-10 Thread Keith Goodman
On Wed, Feb 10, 2010 at 8:01 PM, Robert Kern wrote: > On Wed, Feb 10, 2010 at 21:41, Keith Goodman wrote: >> Here are two arrays that share references: >> x = np.array([1,2,3]) y = x[1:] >> >> and here are two that don't: >> x = np.array([1,2,3]) y = x[1:].copy() >> >> If I di

Re: [Numpy-discussion] Scalar-ndarray arguments passed to not_equal

2010-02-10 Thread Stéfan van der Walt
Hi Friedrich On 10 February 2010 20:57, Friedrich Romstedt wrote: > I wonder why there is no response on my e-mail dating back to Feb 4. > Is there nobody interested in it, is somebody working on it, or did it > simply did not come through?  I changed the recipient now to > "Discussion of Numeric

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Stéfan van der Walt
On 11 February 2010 03:22, David Cournapeau wrote: > I think one issue with versions is that they convey multiple things at > the same time. The number itself conveys an idea of "progress" and > "features" - the bigger the change in the number, the bigger changes > are expected by users. This is t

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-10 Thread Charles R Harris
2010/2/11 Stéfan van der Walt > On 11 February 2010 03:22, David Cournapeau wrote: > > I think one issue with versions is that they convey multiple things at > > the same time. The number itself conveys an idea of "progress" and > > "features" - the bigger the change in the number, the bigger ch