10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 13:53:48 +01:00

Remove NaN for stats to have a result when some values is missing

This commit is contained in:
Mickaël Véril 2019-10-03 09:56:53 +02:00
parent 595b90f798
commit 776134bdcc

View File

@ -129,9 +129,9 @@ draft: false
}
row.appendChild(td)
}
const avals=vals.map(v=>Math.abs(v))
for(const val of [ss.min(vals),ss.max(vals),ss.mean(vals),ss.mean(avals),ss.median(vals),ss.median(avals),ss.rootMeanSquare(vals),ss.variance(vals),ss.standardDeviation(vals)]){
const noNanVals=vals.filter((v)=>!Number.isNaN(v))
const avals=noNanVals.map(v=>Math.abs(v))
for(const val of [ss.min(noNanVals),ss.max(noNanVals),ss.mean(noNanVals),ss.mean(avals),ss.median(noNanVals),ss.median(avals),ss.rootMeanSquare(noNanVals),ss.variance(noNanVals),ss.standardDeviation(noNanVals)]){
var td=document.createElement("td")
td.innerText=noNanPrecision(val,3)
row.appendChild(td)