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+ - Wheels are provided via PyPI for windows users)
Usage :
>>> import jenkspy
>>> import random
>>> list_of_values = [random.random()*5000 for _ in range(12000)]
>>> breaks = jenkspy.jenks_breaks(list_of_values, nb_class=6)
>>> breaks
(0.1259707312994962, 1270.571003315598, 2527.460251085392, 3763.0374498649376, 4999.87456576267)
>>> import json
>>> with open('tests/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)
The 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 :
Making a painless installing C extension so it could be used more easily as a dependency in an other package (and so learning how to build wheels using appveyor).
Getting the break values! (and fast!). No fancy functionnality provided, but contributions/forks/etc are welcome.
Other python implementations are currently existing.
Project details
Release history Release notifications | RSS feed
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.2.tar.gz
(42.3 kB
view hashes)
Built Distributions
Close
Hashes for jenkspy-0.1.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ed41b493eab6c09405744cd39ba070453ce683223ac6944f5ecf752bfe12929 |
|
MD5 | 63576d848fd704745bc3ac2ca80f3ab0 |
|
BLAKE2b-256 | f2a06799715e0d66b3d614f194cb32bad6f644a2a538bf19a9bd246f191cff5e |
Close
Hashes for jenkspy-0.1.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8901c5d9540f519001f6c70302c94a419a06b624053de542ecac5a7b2863e374 |
|
MD5 | de364f5d6d47c95ab08cc789a32ad922 |
|
BLAKE2b-256 | 0121669bb20f6485b1950594be448dae52f38555f8afdae329c14e8970ce37fb |
Close
Hashes for jenkspy-0.1.2-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf57a7bfbe34ba16bd60c772f2ad25bded3d1db52d02c4e637781b6da050e4af |
|
MD5 | 2d97e7ede6ffd6a5cc259bb0e0b2c027 |
|
BLAKE2b-256 | 9fac6205f0b80f443a1e7b5cf5e5e833eda13b2368e6c3977a487a024257cac9 |
Close
Hashes for jenkspy-0.1.2-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66a4d5432fdac7ea006ce20fc809aa112938f8156ae853bc0a8b07ca6470c4fc |
|
MD5 | dafee07fe08defc4ea9492c42f21732d |
|
BLAKE2b-256 | 9c639c0725deb54d93ea87833655114052d1a13b278fd906278f5c3e0a330df9 |
Close
Hashes for jenkspy-0.1.2-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de563db907da5364645c82168ffdc2a77b4f54b6019d2cb7ed5793271d339858 |
|
MD5 | bceda0521fdb553a1317f884e31a7e74 |
|
BLAKE2b-256 | 313036d6dd79992853000f2071e4c3f32ac76dc854f61bf8271050e617ce7a01 |
Close
Hashes for jenkspy-0.1.2-0-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1068f339de99f2b8cd1229fa685c3ed7946b97fbcc6542485f1eb7c4c1ffc76f |
|
MD5 | 5a57cc7395b06815662f7fd89a63dd39 |
|
BLAKE2b-256 | bc2a81049a42466ebc7f924d7cb0d9d8949821ca2a3c9161387b1e55e37e7afc |