Python and Mathematica implementations of Lloyd's algorithm for k-means clustering