title: Which method does pandas use for percentile?
body: <p>I was trying to understand lower/upper percentiles calculation in pandas and got a bit confused. Here is the sample code and output for it.</p>
  
  <pre><code>test = pd.Series([7, 15, 36, 39, 40, 41])
  test.describe()
  </code></pre>
  
  <p>output: </p>
  
  <p><a href="https://i.stack.imgur.com/NamY6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NamY6.png" alt="enter image description here"></a></p>
  
  <p>I am interested in only 25%, 75% percentiles.
  I wonder which method does pandas use to calculate them?</p>
  
  <p>Referring to <a href="https://en.wikipedia.org/wiki/Quartile" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Quartile</a> the article, results are different as following:</p>
  
  <p><a href="https://i.stack.imgur.com/13yfr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/13yfr.png" alt="enter image description here"></a></p>
  
  <p>So what statistical/mathematical method does pandas uses to calculate percentile?</p>