Skip to main content

Compute Natural Breaks (Jenks algorythm)

Project description

Compute “natural” break values (Jenks algorythm) on list/tuple/numpy.ndarray of integers/floats.

(Intented compatibility: CPython 2.7+ and 3.3+)

Build Status travis Build status appveyor

Usage :

>>> import random
>>> list_of_values = [random.random()*5000 for _ in range(12000)]

>>> import jenkspy
>>> breaks = jenkspy.jenks_breaks(list_of_values, nb_class=6)

>>> import json
>>> with open('test.json', 'r') as f:
...     data = json.loads(f.read())
...
>>> jenkspy.jenks_breaks(data, nb_class=5)
(0.0028109620325267315, 2.0935479691252112, 4.205495140049607, 6.178148351609707, 8.09175917180255, 9.997982932254672)

Installation :

pip install jenkspy
git clone http://github.com/mthh/jenkspy
cd jenkspy/
python setup.py install

Requirements (only for building from source):

  • C compiler

  • Python C headers

Motivation :

  • Could be used as an eventual dependency in other package (using appveyor and travis to build wheels for easier installation via pip).

  • Getting the break values! (and fast!)

  • Other python implementations are currently existing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jenkspy-0.1.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

jenkspy-0.1.1-cp35-cp35m-win_amd64.whl (31.8 kB view details)

Uploaded CPython 3.5mWindows x86-64

jenkspy-0.1.1-cp35-cp35m-win32.whl (30.3 kB view details)

Uploaded CPython 3.5mWindows x86

jenkspy-0.1.1-cp34-cp34m-win_amd64.whl (30.0 kB view details)

Uploaded CPython 3.4mWindows x86-64

jenkspy-0.1.1-cp34-cp34m-win32.whl (29.6 kB view details)

Uploaded CPython 3.4mWindows x86

jenkspy-0.1.1-cp27-cp27m-win_amd64.whl (30.1 kB view details)

Uploaded CPython 2.7mWindows x86-64

jenkspy-0.1.1-cp27-cp27m-win32.whl (29.6 kB view details)

Uploaded CPython 2.7mWindows x86

File details

Details for the file jenkspy-0.1.1.tar.gz.

File metadata

  • Download URL: jenkspy-0.1.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jenkspy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0cc09b9e0e9c7c99f00b834cac4e14a9e59d1f1a98ef5e014397f39c486310e5
MD5 6142a6ac9b36042ce4d7d53af12025d9
BLAKE2b-256 82ba74e83afbef266b277f9fa293eb6e61e30c6d8515ab3c517beeeec71ad966

See more details on using hashes here.

File details

Details for the file jenkspy-0.1.1-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for jenkspy-0.1.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a33e195c8c1f38a37def263ffd5e3c11f1a8621fadb8ca142e853eb716c6bc42
MD5 1232cf2b8fa978c03eae147e17ec6710
BLAKE2b-256 095e95966f1fce06bb5f264857d6280bc3ccf877f96248e7db65074e67641731

See more details on using hashes here.

File details

Details for the file jenkspy-0.1.1-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for jenkspy-0.1.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 b77a62cbc894bf03c8a5326baf37dc91694479deecbc5a427a91eb7ffa1336a0
MD5 7aedfe5501d738b808d50e13caffae49
BLAKE2b-256 ffae0f9242f0c2dcd14249a8a4451b1588df8d926edecfa3e7558162d0e43660

See more details on using hashes here.

File details

Details for the file jenkspy-0.1.1-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for jenkspy-0.1.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 bb7f5b8ff5e8da9ac68bd2c46014540c14f7e1a5b4f320c7c69876ab965fea60
MD5 e2d2ca40fcf27b4dacdbec280cb3b1fb
BLAKE2b-256 407d3e334073529c5b122d96b6c126b1ca9100f61bfa7b4c10ca366577125fab

See more details on using hashes here.

File details

Details for the file jenkspy-0.1.1-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for jenkspy-0.1.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 242fdb3462c81ffc163dfdae101ea35fe5a1bfcb6dda42817d50156a37ff3cbe
MD5 397d0c546b8aa74254cd8701d4bdb8e4
BLAKE2b-256 08227df30816636ae1b63ea74e0dfd23e8f9a70c72fbe6040c62bfb3dddc12f1

See more details on using hashes here.

File details

Details for the file jenkspy-0.1.1-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for jenkspy-0.1.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 4f4584067ee679f20001b77f8d33951a2be6d87336697b820aee16e2fd9fbc66
MD5 2446496e79e0177305961fec1dbd6508
BLAKE2b-256 a8346b25e1e98e510e66b09e96f013a2c4df6d2a321557c6992ff6c0d8cf4b49

See more details on using hashes here.

File details

Details for the file jenkspy-0.1.1-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for jenkspy-0.1.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 08f4f2623fb6d098b87c5a08780122fc712630fbaa9b6f27090ce68e342a96c3
MD5 d441f0001c6a2edf1eab96b486d2acf2
BLAKE2b-256 7bf8e8b81a632684cf594b003e675557dacea813152fb49d48cca96ba45ff6f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page