Logo

Programming-Idioms

History of Idiom 203 > diff from v16 to v17

Edit summary for version 17 by breml:
New Go implementation by user [breml]

Version 16

2020-10-08, 14:14:10

Version 17

2020-12-05, 14:13:04

Idiom #203 Calculate mean and standard deviation

Calculate the mean m and the standard deviation s of the list of floating point values data.

Idiom #203 Calculate mean and standard deviation

Calculate the mean m and the standard deviation s of the list of floating point values data.

Variables
m,s,data
Variables
m,s,data
Extra Keywords
avg average variance
Extra Keywords
avg average variance
Imports
import "github.com/gonum/stat"
Code
m, s := stat.MeanStdDev(data, nil)
Comments bubble
github.com/gonum/stat is a third party package, but well established.
Online demo might not run.
Doc URL
https://godoc.org/github.com/gonum/stat#MeanStdDev
Demo URL
https://play.golang.org/p/6B65XedqjyG