Standard deviation of a list

后端 未结 8 1710
旧时难觅i
旧时难觅i 2020-12-07 09:57

I want to find mean and standard deviation of 1st, 2nd,... digits of several (Z) lists. For example, I have

A_rank=[0.8,0.4,1.2,3.7,2.6,5.8]
B_rank=[0.1,2.8,         


        
8条回答
  •  無奈伤痛
    2020-12-07 10:01

    In Python 2.7.1, you may calculate standard deviation using numpy.std() for:

    • Population std: Just use numpy.std() with no additional arguments besides to your data list.
    • Sample std: You need to pass ddof (i.e. Delta Degrees of Freedom) set to 1, as in the following example:

    numpy.std(< your-list >, ddof=1)

    The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.

    It calculates sample std rather than population std.

提交回复
热议问题