Re: eucledian dist calculations

2008-01-25 Thread nodrogbrown
sorry..the last post didn't appear! > Are you sure? What happens if the vector with the smallest > sum(distance) is the first one? > initially i will set imgindex =0 so if the first one is of smallest sum..,the image will be reteived by imgindex 0 > (a) Can't you replace the inner loop with

Re: eucledian dist calculations

2008-01-21 Thread nodrogbrown
> > 1. 'temp' is not used > 2. Lose the superfluous parentheses in 'if' statements > 3. Put space around operators > 4. I've never used any of numpy & friends, but: > (a) Can't you replace the inner loop with something like this: >distance = abs(input_weight - weights[image, :]) > (b) I doubt

Re: eucledian dist calculations

2008-01-21 Thread John Machin
On Jan 21, 6:44 pm, nodrogbrown <[EMAIL PROTECTED]> wrote: > hi > i am using python to do some image data calculations..I use the > following numpy.ndarrays ,(i have given their shapes and ranks) > > weights=ndarray :shape(100,30),ndim=2 will have vals like > 2458121847.49 (of type 'numpy.float6

eucledian dist calculations

2008-01-20 Thread nodrogbrown
hi i am using python to do some image data calculations..I use the following numpy.ndarrays ,(i have given their shapes and ranks) weights=ndarray :shape(100,30),ndim=2 will have vals like 2458121847.49 (of type 'numpy.float64') input_weight=ndarray :shape(30,),ndim=1 (similar to above but diff