Produces a map from the input elements to the frequency in which they appear in the input collection.
Produces a map from the input elements to the frequency in which they appear in the input collection.
For example: {{ val x = List("a", "a", "b", "a") val m = x.counted }}
produces Map("a" -> 3, "b" -> 1)
. The map has a default value of zero,
so calling m("c")
returns zero.
a map with the elements counted.
Calculates the mean and variance of the collection.
Calculates the mean and variance of the collection.
numerical view of the element type
a tuple consisting of _1
mean and _2
variance.
Normalizes the elements by finding the maximum absolute value and dividing each element by this value.
Normalizes the elements by finding the maximum absolute value and dividing each element by this value.
If the collection is empty or the maximum absolute value is zero, the original collection is returned.
numerical view of the element type
Enrichment methods for any type of collection, sequential or not.