Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how is pandas kurtosis defined?

Tags:

pandas

I am trying to get kurtosis using pandas. By doing some exploration, I have

test_series = pd.Series(np.random.randn(5000))
test_series.kurtosis()

however, the output is:

-0.006755982906479385

But I think the kurtosis (https://en.wikipedia.org/wiki/Kurtosis) should be close to (maybe normalize over N-1 instead of N, but this does not matter here)

(test_series - test_series.mean()).pow(4).mean()/np.power(test_series.std(),4)

which is

2.9908543104146026
like image 614
user40780 Avatar asked Oct 12 '25 18:10

user40780


1 Answers

The pandas documentation says the following

Return unbiased kurtosis over requested axis using Fisher’s definition of kurtosis (kurtosis of normal == 0.0)

This is probably the excess kurtosis, defined as kurtosis - 3.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!