Skip to main content

A python implementation of XKCD''s Geothmetic Meandian ( )

Project description


A python implementation of XKCD's Geothmetic Meandian ( )

Simply run

>>> from GMDN import GMDN
>>> GMDN([1, 1, 2, 3, 5])

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)

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 hashes)

Uploaded source

Built Distribution

GMDN-1.0.1-py3-none-any.whl (3.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page