<p>This sort of discrepancies are normally due to the <a href="https://en.wikipedia.org/wiki/Percentile#The_linear_interpolation_between_closest_ranks_method" rel="nofollow noreferrer">interpolation method</a>, very noticeable when the sample is very small.</p>
<p>However, 6055 is exactly percentile 75 in your sample:</p>
<pre><code>1563   2731   3586   3966   4174   4971   6055   9175  15667
 0/8    1/8    2/8    3/8    4/8    5/8    6/8    7/8    8/8
   0  0.125   0.25  0.375    0.5  0.625   0.75  0.875      1
</code></pre>
<p>Accordingly, Numpy produces the same result using any of its <a href="https://numpy.org/doc/stable/reference/generated/numpy.quantile.html" rel="nofollow noreferrer">interpolation methods</a> (linear, lower, higher, nearest, midpoint).</p>
<p>Dynatrace may be using a more complex interpolation method like <a href="https://arxiv.org/abs/1902.04023" rel="nofollow noreferrer">this one</a>. One of the authors is affiliated to Dynatrace.</p>
Nth percentile in python is different from Dynatrace result
<p>I am trying to create a report based on the data extracted from Dynatrace.</p>
<p>I am extracting the data on daily basis for the events, in my Python Django report, I need to show the Nth percentile data (like <em>30</em>th percentile, <em>60</em>th Percentile, <em>75</em>th Percentile, <em>90</em>th Percentile).</p>
<p>When I try to pull the data from Dynatrace the below list is the result:
<code>[1563,2731,3586,3966,4174,4971,6055,9175,15667]</code></p>
<p>For this list, when I use numpy.percentile or df.quantile, I am getting one value which is similar to the percentile value like the formula I used in Excel
However the Dynatrace PERCENTILE function is showing a different value all together</p>
<p>For example, From the excel and Python, I am getting 75th Percentile as - <strong>6055</strong>
From Dynatrace I am getting - <strong>6835</strong></p>
<p>I tried to use some online tools to calculate the Percentile but all seems to be giving 6055.
If someone can explain this how <strong>DynaTrace</strong> is calculating this formula that would be a great help</p>
<p>Thanks in advance</p>