diff --git a/statistics/csv/summary.html b/statistics/csv/summary.html
index bc6f8dd..45d96ef 100644
--- a/statistics/csv/summary.html
+++ b/statistics/csv/summary.html
@@ -88,9 +88,10 @@
Please, select a CSV
for (let i = 0; i < headers.length; i++) {
const header = headers[i];
- const mean = res.empirical_mean.shift();
- const variance = res.empirical_variance.shift();
- const std_deviation = res.empirical_std_deviation.shift();
+ // if calculated, then ...
+ const mean = res.empirical_mean === false ? null : res.empirical_mean.shift();
+ const variance = res.empirical_variance === false ? null : res.empirical_variance.shift();
+ const std_deviation = res.empirical_std_deviation === false ? null : res.empirical_std_deviation.shift();
let bundle = {error: false, text: ""};
@@ -112,6 +113,7 @@ Please, select a CSV
}
results_div.innerHTML = ``
} catch (e) {
+ console.log(e)
results_div.innerHTML = 'Dataset is empty.';
}
}
@@ -119,10 +121,15 @@ Please, select a CSV
function checkResultAndAppend(value, bundle) {
let type = typeof value;
if (type !== "boolean") {
- if (type === "string") { // error
- bundle.error = true;
+ if (value != null) {
+ if (type === "string") { // error
+ bundle.error = true;
+ }
+ bundle.text += `${value} | `;
+ } else {
+ // not calculated
+ bundle.text += `x | `;
}
- bundle.text += `${value} | `;
return bundle;
}
}