title: Getting numbers within a range from a gaussian_kde_resample array
body: <p>I have a <code>gaussian_kde.resample</code> array. I don't know if it is a numpy array so that I can use numpy functions. </p>
  
  <p>I had the data <code>0&lt;x&lt;=0.5</code> of 3000 variables and I used </p>
  
  <pre><code>kde = scipy.stats.gaussian_kde(x) # can also mention bandwidth here (x,bandwidth)
  sample = kde.resample(100000) # returns 100,000 values that follow the prob distribution of "x"
  </code></pre>
  
  <p>This gave me a sample of data that follows the probability distribution of <code>"x"</code>. But the problem is, no matter what bandwidth I try to select, I get very few negative values in my <code>"sample"</code>. <strong><code>I only want values within the range 0 &lt; sample &lt;= 0.5</code></strong> </p>
  
  <p>I tried to do: </p>
  
  <pre><code> sample = np.array(sample) # to convert this to a numpy array
   keep = 0&lt;sample&lt;=0.5
   sample = sample[keep] # using the binary conditions
  </code></pre>
  
  <p>But this does not work! How can I remove the negative values in my array? </p>