Standard Deviation

Calculate the standard deviation of an array of numbers.

Code

General
echo "$arr" | tr -d '[]' | tr ',' '\n' | awk '{sum+=$1; sq+=$1*$1; n++} END{print sqrt(sq/n - (sum/n)^2)}'

Parameters

JSON array of numbers

Server

More Bash Snippets