How does pandas calculate skew
<p>I'm calculating a coskew matrix and wanted to double check my calculation with pandas built in <code>skew</code> method.  I could not reconcile how pandas performing the calculation.</p>

<p>define my series as:</p>

<pre><code>import pandas as pd

series = pd.Series(
    {0: -0.051917457635120283,
     1: -0.070071606515280632,
     2: -0.11204865874074735,
     3: -0.14679988245503134,
     4: -0.088062467095565145,
     5: 0.17579741198527793,
     6: -0.10765856028420773,
     7: -0.11971470229167547,
     8: -0.15169210769159247,
     9: -0.038616800990881606,
     10: 0.16988162977411481,
     11: 0.092999418364443032}
)
</code></pre>

<p>I compared the following calculations and expected them to be the same.</p>

<h3>pandas</h3>

<pre><code>series.skew()

1.1119637586658944
</code></pre>

<h3>me</h3>

<pre><code>(((series - series.mean()) / series.std(ddof=0)) ** 3).mean()

0.967840223081231
</code></pre>

<h3>me - take 2</h3>

<p>This is significantly different.  I thought it might be <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm" rel="noreferrer">Fisher-Pearson coefficient</a>.  So I did:</p>

<pre><code>n = len(series)
skew = series.sub(series.mean()).div(series.std(ddof=0)).apply(lambda x: x ** 3).mean()
skew * (n * (n - 1)) ** 0.5 / (n - 1)

1.0108761442417222
</code></pre>

<p>Still off by quite a bit.</p>

<h3>Question</h3>

<p>How does pandas calculate skew?</p>