[Numpy-discussion] Array of Arrays

2007-03-23 Thread Alexander Michael
How can I do something like the following? a = empty((5,7), dtype=4 element array of floats) c = a[:,-1] # last column of 4 element arrays a[0,0] = 2.0 print a[0,0] [2. 2. 2. 2.] a[1,0] = 3.0 a[0,1] = a[0,0] * a[1,0] print a[0,1] [6. 6. 6. 6.] etc. As always, thanks for the help! Alex

Re: [Numpy-discussion] histogramdd shapes

2007-03-23 Thread David Huard
Thanks Ben, I submitted a patch with your fix. Ticket 189 http://projects.scipy.org/scipy/numpy/ticket/189 David 2007/3/17, Ben Granett [EMAIL PROTECTED]: Hi, There seems to be a problem with histogramdd (numpy 1.0.1). Depending on the number of bins in each axis, it may not produce an

Re: [Numpy-discussion] nd_image.affine_transform edge effects

2007-03-23 Thread Travis Oliphant
Stefan van der Walt wrote: On Thu, Mar 22, 2007 at 04:33:53PM -0700, Travis Oliphant wrote: I would rather opt for changing the spline fitting algorithm than for padding with zeros. From what I understand, the splines used in ndimage have the implicit mirror-symmetric boundary

Re: [Numpy-discussion] nd_image.affine_transform edge effects

2007-03-23 Thread Travis Oliphant
James Turner wrote: By the way, ringing at sharp edges is an intrinsic feature of higher- order spline interpolation, right? I believe this kind of interpolant is really intended for smooth (band-limited) data. I'm not sure why the pre-filtering makes a difference though; I don't yet understand

Re: [Numpy-discussion] concatenating 1-D arrays to 2D

2007-03-23 Thread Sebastian Haase
On 3/22/07, Bill Baxter [EMAIL PROTECTED] wrote: On 3/23/07, Eric Firing [EMAIL PROTECTED] wrote: Sebastian Haase wrote: On 3/22/07, Stefan van der Walt [EMAIL PROTECTED] wrote: On Thu, Mar 22, 2007 at 08:13:22PM -0400, Brian Blais wrote: Hello, I'd like to concatenate a couple

Re: [Numpy-discussion] nd_image.affine_transform edge effects

2007-03-23 Thread Zachary Pincus
Hello all, On Mar 23, 2007, at 3:04 AM, Stefan van der Walt wrote: On Thu, Mar 22, 2007 at 11:20:37PM -0700, Zachary Pincus wrote: The actual transform operators then use these coefficients to (properly) compute pixel values at different locations. I just assumed that the pre-filtering was

Re: [Numpy-discussion] concatenating 1-D arrays to 2D

2007-03-23 Thread Stefan van der Walt
On Fri, Mar 23, 2007 at 11:09:03AM -0400, Robert Pyle wrote: In [65]:concatenate((a.reshape(10,1),b.reshape(10,1)),axis=1) Out[65]: array([[ 0, -10], [ 1, -9], [ 2, -8], [ 3, -7], [ 4, -6], [ 5, -5], [ 6, -4],

Re: [Numpy-discussion] concatenating 1-D arrays to 2D

2007-03-23 Thread Bill Baxter
On 3/24/07, Sebastian Haase [EMAIL PROTECTED] wrote: Then of course, there's r_ and c_: c = numpy.c_[a,b] c = numpy.r_[a[None],b[None]].T --bb So, None is the same as newaxis - right? Yes, newaxis is None. None is newaxis. Same thing. I just don't see much advantage in

[Numpy-discussion] swig svn commits

2007-03-23 Thread Sebastian Haase
Hi, this is regarding the svn commit by wfspotz. Author: [EMAIL PROTECTED] Date: 2007-03-23 13:04:37 -0500 (Fri, 23 Mar 2007) New Revision: 3593 Modified: trunk/numpy/doc/swig/numpy.i Log: Added typecheck typemaps to INPLACE_ARRAY typemap suites Hi wfspotz, I was just wondering if you

Re: [Numpy-discussion] Array of Arrays

2007-03-23 Thread Sebastian Haase
On 3/23/07, Alexander Michael [EMAIL PROTECTED] wrote: On 3/23/07, Nadav Horesh [EMAIL PROTECTED] wrote: How about a = empty((5,7,4)) c = a[...,-1] Solely because I want to use the array with code that assumes it is working with two-dimensional arrays but yet only performs operations

Re: [Numpy-discussion] Array of Arrays

2007-03-23 Thread Alexander Michael
On 3/23/07, Sebastian Haase [EMAIL PROTECTED] wrote: Hold on -- aren't the ... at the *end* always implicit: I you have a.shape = (6,5,4,3) a[3,2] is the same as a[3,2,:,:] is the same as a[3,2,...] only if you wanted a[...,3,2] you would have to change your code !? Am I confused !? Ha!

[Numpy-discussion] Detect subclass of ndarray

2007-03-23 Thread Charles R Harris
Anyone, What is the easiest way to detect in python/C if an object is a subclass of ndarray? Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-23 Thread Bill Baxter
I mentioned in another thread Travis started on the scipy list that I would find it useful if there were a function like dot() that could multiply more than just two things. Here's a sample implementation called 'mdot'. mdot(a,b,c,d) == dot(dot(dot(a,b),c),d) mdot(a,(b,c),d) ==

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-23 Thread Anne Archibald
On 24/03/07, Bill Baxter [EMAIL PROTECTED] wrote: I mentioned in another thread Travis started on the scipy list that I would find it useful if there were a function like dot() that could multiply more than just two things. Here's a sample implementation called 'mdot'. mdot(a,b,c,d) ==

Re: [Numpy-discussion] Detect subclass of ndarray

2007-03-23 Thread Anne Archibald
On 23/03/07, Charles R Harris [EMAIL PROTECTED] wrote: Anyone, What is the easiest way to detect in python/C if an object is a subclass of ndarray? Um, how about isinstance or issubclass? (if you want strictness you can look at whether x.__class__ is zeros(1).__class__) Anne

[Numpy-discussion] nd_image.affine_transform edge effects

2007-03-23 Thread James Turner
Hi Zach, Hmm, this is worrisome. There really shouldn't be ringing on continuous-tone images like Lena -- right? (And at no step in an image like that should gaussian filtering be necessary if you're doing spline interpolation -- also right?) That's hard to say. Just because it's mainly a