title: np.percentile not equal to quartiles
body: <p>I'm trying to calculate the quartiles for an array of values in python using <code>numpy</code>.</p>
  
  <pre><code>X = [1, 1, 1, 3, 4, 5, 5, 7, 8, 9, 10, 1000]
  </code></pre>
  
  <p>I would do the following:</p>
  
  <pre><code>quartiles = np.percentile(X, range(0, 100, 25))
  quartiles
  # array([1.  ,  2.5 ,  5.  ,  8.25])
  </code></pre>
  
  <p>But this is incorrect, as the 1st and 3rd quartiles should be 2 and 8.5, respectively.</p>
  
  <p>This can be shown as the following:</p>
  
  <pre><code>Q1 = np.median(X[:len(X)/2])
  Q3 = np.median(X[len(X):])
  Q1, Q3
  # (2.0, 8.5)
  </code></pre>
  
  <p>I can't get my heads round what <code>np.percentile</code> is doing to give a different answer. Any light shed on this, I'd be very grateful for.</p>