Python: Generate random values from empirical distribution
Clash Royale CLAN TAG #URR8PPP Python: Generate random values from empirical distribution In Java, I usually rely on the org.apache.commons.math3.random.EmpiricalDistribution class to do the following: Is there any Python library that provides the same functionality? It seems like scipy.stats.gaussian_kde.resample does something similar, but I'm not sure if it implements the same procedure as the Java type I'm familiar with. I think the accepted answer here has what you're looking for. – Kevin Feb 16 '16 at 14:42 @Kevin: the linked answer doesn't work for this case, because it assumes you already know the analytical form of your distribution, whereas this question is looking for something non-parametric. – abeboparebop Aug 7 at 13:46 1 Answer 1 import numpy as np import scipy import matplotlib.pyplot as plt # This represents the original "empirical" sample -- I fake it by # sampling from a normal distribution orig_sample_data = np.rand...