title: Creating a data that follows a spcific data distribution
body: <p>I have a variable <code>x</code> of 2700 points. It is my original data.</p>
  
  <p>The <strong>HISTOGRAM</strong> of my data looks like this. The cyan color line is the distribution my data follows. I used <code>curve_fit</code> to my histogram and obtained the fitted curve. The fitted curve is a numpy array of 100000 points.</p>
  
  <p><img src="https://i.stack.imgur.com/wrB89.png" alt="enter image description here"></p>
  
  <p>I want to generate a smoothed <code>random data</code>, of say 100000 points, that follows the <strong>DISTRIBUTION</strong> of my <code>original data</code>. <strong><code>i.e in principle I want 100000 points below the fitted curve, starting from 0.0 and increasing in the same way as the curve till 0.5</code></strong> </p>
  
  <p>What I have tried so far to get 100000 points below the curve is:</p>
  
  <p>I generated uniform random numbers using <code>np.random.uniform(0,0.5,100000)</code>   </p>
  
  <pre><code>random_x = []
  
  u = np.random.uniform(0,0.5,100000)
  
  for i in u:
      if i&lt;=y_ran:  # here y_ran is the numpy array of the fitted curve
          random_x.append(i)
  </code></pre>
  
  <p>But I get an error `ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</p>
  
  <p>I know the above code is not the proper one, but how should I proceed further?? 
  `</p>