In [3]:
from random import expovariate, randint
import matplotlib.pyplot as plt
import seaborn as sbn
import numpy as np
from scipy.stats import expon, poisson
%matplotlib notebook
In [15]:
randint(-1, 1)
Out[15]:
In [2]:
times = np.zeros((1000,1000))
for i in range(1000):
for j in range(1000):
times[i, j] = expovariate(10)
In [23]:
sbn.distplot(times[0], fit=expon, kde=False)
Out[23]:
In [24]:
cumtimes = times.cumsum(axis=1)
counts = []
for i in range(1000):
counts.append(cumtimes[i][cumtimes[i] <= 1.0].size)
In [26]:
fig, ax = plt.subplots()
sbn.distplot(counts, bins=21, ax=ax, kde=False, norm_hist=True)
ax.plot(poisson(10).pmf(range(20)))
Out[26]:
In [17]:
a = {}
In [18]:
type(a)
Out[18]:
In [19]:
from uuid import uuid4
In [34]:
a = 5
In [23]:
a
Out[23]:
In [24]:
from random import sample
In [33]:
sample(a.keys(), 1)
Out[33]:
In [35]:
b = {2: 'hello',
3: 'world'}
In [36]:
b[2] = 'susi'
In [38]:
b.pop(2)
Out[38]:
In [39]:
b
Out[39]:
In [40]:
def f():
pass
In [42]:
f()
In [ ]: