title: Fitting a distribution given the histogram using scipy
body: <p>I would like to fit a distribution using scipy (in my case, using weibull_min) to my data. Is it possible to do this given the Histogram, and not the data points? In my case, because the histogram has integer bins of size 1, I know that I can extrapolate my data in the following way:</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  orig_hist = np.array([10, 5, 3, 2, 1])
  
  ext_data = reduce(lambda x,y: x+y, [[i]*x for i, x in enumerate(orig_hist)])
  </code></pre>
  
  <p>In this case, ext_data would hold this:</p>
  
  <pre><code>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4]
  </code></pre>
  
  <p>And building the histogram using:</p>
  
  <pre><code>np.histogram(ext_data, bins=5)
  </code></pre>
  
  <p>would be equivalent to orig_hist</p>
  
  <p>Yet, given that I already have the histogram built, I would like to avoid extrapolating the data and use orig_hist to fit the distribution, but I don't know if it is possible to use it directly in the fitting procedure. Additionally, is there a numpy function that can be used to perform something similar to the extrapolation I showed?</p>