Skip to content

Instantly share code, notes, and snippets.

@amorton
Created July 24, 2011 23:59
Show Gist options
  • Save amorton/1103267 to your computer and use it in GitHub Desktop.
Save amorton/1103267 to your computer and use it in GitHub Desktop.
100 hits a minute, distributed per second using Poisson distributed
In [6]: import numpy as np
In [7]: np.random.po
np.random.poisson np.random.power
In [7]: np.random.poisson(100 / 60.0, 60)
Out[7]:
array([0, 2, 2, 1, 4, 3, 5, 3, 1, 0, 3, 1, 1, 1, 1, 2, 3, 2, 2, 0, 3, 2, 0,
2, 3, 1, 2, 1, 4, 1, 5, 1, 3, 1, 1, 3, 1, 3, 1, 1, 0, 1, 3, 1, 2, 4,
2, 3, 4, 2, 3, 3, 4, 3, 3, 1, 2, 3, 1, 1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment