Python function implementing the head-tail breaks algorithm, a classification scheme for data with a heavy-tailed distribution. It works well for choropleth map coloring and data classification. JavaScript code included for reference.
Original paper, see here >> http://arxiv.org/ftp/arxiv/papers/1209/1209.2801.pdf