A python implementation of XKCD''s Geothmetic Meandian ( https://xkcd.com/2435/ )
Project description
GMDN
A python implementation of XKCD's Geothmetic Meandian ( https://xkcd.com/2435/ )
Simply run
>>> from GMDN import GMDN
>>> GMDN([1, 1, 2, 3, 5])
2.0890566336242085
One can optionally include a limit, for how close the highest and lowest mean/median should be to accept the answer. The limit defaults to 0.00001. Note that the function returns the median of the result.
>>> from GMDN import GMDN
>>> GMDN([1, 1, 2, 3, 5], 1)
2
GMDN can also be used to get a tuple of (arithmetic mean, geometric mean, median), using geothmetic_mean found in GMDN.helpers:
>>> from GMDN.helpers import geothmetic_meandian
>>> geothmetic_meandian([1, 1, 2, 3, 5])
(2.4, 1.97435048583482, 2)
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
GMDN-1.0.1.tar.gz
(2.6 kB
view details)
Built Distribution
GMDN-1.0.1-py3-none-any.whl
(3.7 kB
view details)
File details
Details for the file GMDN-1.0.1.tar.gz
.
File metadata
- Download URL: GMDN-1.0.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77cbc94c53d5bf9aaa8ee6a25b04afa3b2c39c90c6a94147db3d41bda06c0ad7 |
|
MD5 | a6ca2943b1706507383dd4d463727d18 |
|
BLAKE2b-256 | b1bae04e17aaeaedeca3bb7142033438f9360045343de0662d10ba7632c6e6ae |
File details
Details for the file GMDN-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: GMDN-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e0f78e100bf5d6cbf38ec8581acbb3888a4ab64e502d14ca4b50c1bc14af3c5 |
|
MD5 | 84001c49b0fee03f648aa9d1937de813 |
|
BLAKE2b-256 | ccdafc689ba9869b6d982f322c4bd378471a7e19d2890f95070342713ab49956 |