In [1]:
import numpy as np
import scipy.stats as spst
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
import numpy as np
x=np.array([1,2,10])
px=np.array([0.49,0.49,0.02])
cdf=np.cumsum(px)
def inverse():
u=np.random.rand()
if u