Skip to main content

Solutions to Mango's Python Coding Test

Project description

# mango_test

Package containing Peter Ling’s solutions to the Mango Python coding test, September 2020.

## Installation

The package can be installed from PyPI via the command line by typing pip install mango_coding_test_pl_sept20.

## Usage

The solutions can then be used in a Python 3 environment after using the import statement from mango_test import mango_test as mt

#### Functions The ‘Functions’ part of the exercise is called with the random_draw(nsamples, dist, **params) function, where params relate to the given distribution.

##### Examples To return a 10 random samples (as a numpy array) from a Normal distribution with mean 100 and standard deviation 10:

mt.random_draw(10, ‘normal’, mean=100, sd=10)

To return a 20 random samples from a Binomial distribution with _n_=100, _p_=0.5:

mt.random_draw(20, ‘binomial’, n=100, p=0.5)

To return a 100 random samples from a Poisson distribution with $lambda$=100:

mt.random_draw(100, ‘poisson’, lam=100)

#### Object-oriented Programming The ‘Object-oriented Programming’ part of the exercise is called with the Sample class.

##### Example To create an instance of the Sample class, using the Normal distribution:

s = mt.Sample(‘normal’)

To set the parameters of s (mean and standard deviation):

s.mean = 100 s.sd = 100

To draw a 1000 samples from s, then summarise:

s.draw(1000) s.summarise()

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

mango_coding_test_pl_sept20-2.0.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

mango_coding_test_pl_sept20-2.0.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file mango_coding_test_pl_sept20-2.0.0.tar.gz.

File metadata

  • Download URL: mango_coding_test_pl_sept20-2.0.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for mango_coding_test_pl_sept20-2.0.0.tar.gz
Algorithm Hash digest
SHA256 bd0c485ed4c072ba8fd00f8384295005cfbfb7ed51e6ef3a7e284febf48187b3
MD5 d7a467925ca0a9275a3d569de76b2256
BLAKE2b-256 94ebc70984c4f1ed05b267bd47c1477571d9bc667511152f957dbfd2968397ab

See more details on using hashes here.

File details

Details for the file mango_coding_test_pl_sept20-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: mango_coding_test_pl_sept20-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.10

File hashes

Hashes for mango_coding_test_pl_sept20-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68494396b309ce4a8fabd8614c8fbeb73304b3371de66929610d5a84949a8ca2
MD5 b0f1a4115a186548c924167a29133f21
BLAKE2b-256 37aa0b6179db51bcc1420a7a1191bd69f7bf3631f6b5398bd627c5dd78e6cd73

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