Skip to content

Instantly share code, notes, and snippets.

@josep2
Created December 19, 2016 16:16
Show Gist options
  • Save josep2/42daeb41f45259f8fc5d5970aac2dafa to your computer and use it in GitHub Desktop.
Save josep2/42daeb41f45259f8fc5d5970aac2dafa to your computer and use it in GitHub Desktop.
def harmonicMean(values: Seq[Double]): Double = {
values.length / values.map(v => 1.0 / v).sum
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment