Home > other >  How to write degoffreedom in python? This is a function...
How to write degoffreedom in python? This is a function...

Time:09-18

Subject to say to want to put the degoffreedom write variance function to calculate the sample variance or population variance, but after I have written to the detection result no change ah,,,
Concrete is subject to say to want to write a degoffreedom in variance parameters default to 1 is the sample, then I write in found don't write as if nothing changes.
Def scheme (li=[1, 2, 3, 4, 5, 10, 2000, 30]) : # 4 th question
Return the sum (li)/len (li)

Def variance (li=[1, 2, 3, 4, 5, 10, 2000, 30], degoffreedom=0) :
Sum2=0
For I in range (len (li) :
Sum1=li [I] - scheme ()
* * 2 +=sum2 sum1
Print (sum2/len (li))
Variance ()

Picture is topic

CodePudding user response:

Useless ah, light as parameters in the function to use it to judge, if it is a writing sample function, if write variance function is zero

CodePudding user response:

reference 1st floor chuifengde response:
light written arguments useless ah, want to use it to judge in function, if it is a writing sample function, if 0 is write variance function

I seemed to understand,,, thank you
  • Related