python - Different std in pandas vs numpy -


Standard deviation is different between pandas and numpy. Why and which is right? (The relative difference is 3.5% which should not come from the sphere, it is high in my opinion).

Example

  NP import pandas Stringaio as PDS numpy Stringaio imports as import e = '0.057411 0.024367 0.021247 - 0.00180 9 -0.010874 -0.035845 0.001663 0.043282 0.004433 -0.007242 0.029294 0.023699 0.049654 0.034422 -0.005380 '' 'df = pd.read_csv (Stringaio (e. bar)), Delim_whitespace = true, header = none) df.std () == np .std (df) # false df.std () # 0.025801 np.std (df) # 0.024926 (0.024 926 - 0.025801) / 0.024926 # 3.5% relative difference  

I have these versions uses have:

pandas '0.14.0' oval: '1.8.1'

In short Does not have the "wrong" use Pandas ( N-1 in each language), while it is not normal by normal.

for them to behave the same way, have ddof = 1


  • Comments

    Popular posts from this blog

    java - org.apache.http.ProtocolException: Target host is not specified -

    java - Gradle dependencies: compile project by relative path -

    ruby on rails - Object doesn't support #inspect when used with .include -