Closed
Description
This term is used in valueCounts and statistical operations: std, mean, varianceAndMean
https://kotlin.github.io/dataframe/valuecounts.html
In documentation, there is no explanation of what it means. What's the difference from NaN?
In the following function, skipNA used when the value is NaN.
public fun Sequence<Float>.mean(skipNA: Boolean = skipNA_default): Double {
var count = 0
var sum: Double = 0.toDouble()
for (element in this) {
if (element.isNaN()) {
if (skipNA) continue
else return Double.NaN
}
sum += element
count++
}
return if (count > 0) sum / count else Double.NaN
}