>> But even if indices = array, one still needs to do something like:
>> for index in indices: histogram[index] += 1
>>
>> Which is slow in python and fast in C.
>>
>>
> I thought of a broadcasting approach... what are the chances that a  
> simple
>
> bins[:] = 0
> bins[ img.flat ] += 1

That doesn't work cumulatively, it seems. Some bins get a value of  
'1', but it never gets incremented past that.

It was worth a try, though... in some cases in-place updating seems to  
work this way (which is usually a source of confusion on this list,  
not the desired result!)

Zach
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to