def dist_kl(p: Prob, q: Prob):
    'Kullback-Leibler divergence between two probability distributions.'
    kl_div = (p.p * (np.log((p.p + (p == 0))) - np.log((q.p + (p.p == 0)))))
    return np.sum(kl_div)
Kullback-Leibler divergence between two probability distributions.
def dist_kl(p: Prob, q: Prob):
    
    kl_div = (p.p * (np.log((p.p + (p == 0))) - np.log((q.p + (p.p == 0)))))
    return np.sum(kl_div)