Why numpy and pandas both the library give different output if we calculate standard deviation?

Viewed 18

Refer to the code shown below:

import numpy as np
import pandas as pd
fir_salary = [10000,20000,15000,20000,15000,25000]
df=pd.DataFrame(fir_salary)

print(np.std(fir_salary))
print(df.std()) <-- Return different output

I have referred to the thread Different Standard Deviation in Pandas and Numpy which talks about the degree of freedom.

But I need help to understand what exactly is the degree of freedom. Does it have to do anything with sample and population standard deviation calculations?

0 Answers
Related