Re: [Numpy-discussion] "Manually" broadcasting arrays in Python

2006-10-06 Thread Stefan van der Walt
On Wed, Oct 04, 2006 at 01:37:55AM -0400, A. M. Archibald wrote: > Would it be useful for me to contribute the tiny script I wrote to > trigger it as a regression test? > > A. M. Archibald > > from numpy import vectorize, zeros > > vt = vectorize(lambda *args: args) > # Removing either of the fo

Re: [Numpy-discussion] "Manually" broadcasting arrays in Python

2006-10-03 Thread A. M. Archibald
On 04/10/06, Robert Kern <[EMAIL PROTECTED]> wrote: Yeah, a segfault would be problematic. Otherwise, it works and is in fact faster than what I wrote. It's a bit tricky to trigger but I think it was fixed in 1.0rc1 (in changeset 3125, in fact: http://projects.scipy.org/scipy/numpy/changeset/3

Re: [Numpy-discussion] "Manually" broadcasting arrays in Python

2006-10-03 Thread Robert Kern
A. M. Archibald wrote: > On 03/10/06, Robert Kern <[EMAIL PROTECTED]> wrote: >> Has anyone implemented an easier or more efficient way to broadcast arrays >> to a >> common shape at the Python level? I was hoping that the broadcast iterator >> would >> actually provide the broadcasted arrays, but

Re: [Numpy-discussion] "Manually" broadcasting arrays in Python

2006-10-03 Thread A. M. Archibald
On 03/10/06, Robert Kern <[EMAIL PROTECTED]> wrote: > Has anyone implemented an easier or more efficient way to broadcast arrays to > a > common shape at the Python level? I was hoping that the broadcast iterator > would > actually provide the broadcasted arrays, but it does not. How about vecto

[Numpy-discussion] "Manually" broadcasting arrays in Python

2006-10-03 Thread Robert Kern
Has anyone implemented an easier or more efficient way to broadcast arrays to a common shape at the Python level? I was hoping that the broadcast iterator would actually provide the broadcasted arrays, but it does not. I've attached my best pure-Python effort. -- Robert Kern "I have come to b