Faster kmeans
Faster kmeans

This makes only one pass through assignments for the counts (actually,
it internally does more, but it's probably still O(N log N) vs. O(N k)).
This is about 16% faster for k=100 (of course, the difference is larger
for larger k). Using something like mahotas.fullhistogram (which does
the same in C), would be probably an extra 5% faster.

Measurements shows that it's still faster for K=2!

pombredanne/milk,luispedro/milk,luispedro/milk,luispedro/milk,pombredanne/milk,pombredanne/milk