title: Percentage of array between values
body: <p>Im searching for an easy way to find which percentage of the data is within certain intervals using python.</p>
  
  <p>Consider an array X of float values. I'd like to do something similar to quantiles:</p>
  
  <pre><code>X.quantile(np.linspace(0,1,11))
  </code></pre>
  
  <p>But instead, I'd like to know which percentage of values are within -10 and 10, for example.</p>
  
  <pre><code>X.method([-10,10])
  </code></pre>
  
  <p>I know I can do that with <code>scipy.stats.percentileofscore</code> doing</p>
  
  <pre><code>percentileofscore(X,10) - percentileofscore(X,-10)
  </code></pre>
  
  <p>I was wondering whether there's a simpler, implemented solution so I could do instead</p>
  
  <pre><code>X.method([a,b,c])
  </code></pre>
  
  <p>Which would give me the percentage of values between the <code>min(X)</code> and <code>a</code>, <code>a</code> and <code>b</code>,  <code>b</code> and <code>c</code>, and finally between <code>c</code> and <code>max(X)</code></p>