Skip to main content

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)

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)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

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

Hashes for GMDN-1.0.1.tar.gz
Algorithm Hash digest
SHA256 77cbc94c53d5bf9aaa8ee6a25b04afa3b2c39c90c6a94147db3d41bda06c0ad7
MD5 a6ca2943b1706507383dd4d463727d18
BLAKE2b-256 b1bae04e17aaeaedeca3bb7142033438f9360045343de0662d10ba7632c6e6ae

See more details on using hashes here.

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

Hashes for GMDN-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e0f78e100bf5d6cbf38ec8581acbb3888a4ab64e502d14ca4b50c1bc14af3c5
MD5 84001c49b0fee03f648aa9d1937de813
BLAKE2b-256 ccdafc689ba9869b6d982f322c4bd378471a7e19d2890f95070342713ab49956

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

0.1.0

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

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