Skip to content

Instantly share code, notes, and snippets.

@josep2
Created December 19, 2016 16:53
Show Gist options
  • Save josep2/fa5370fb3438ec522f18e170fc892085 to your computer and use it in GitHub Desktop.
Save josep2/fa5370fb3438ec522f18e170fc892085 to your computer and use it in GitHub Desktop.
val harmonic = new HarmonicMean
data.agg(harmonic(col("sales")).as("HarmonicMean")).show()
+-----------------+
| GeometricMean|
+-----------------+
|473.3701657458564|
+-----------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment