aboutsummaryrefslogtreecommitdiffstats
path: root/libprakpp/include/praktable.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libprakpp/include/praktable.hpp')
-rw-r--r--libprakpp/include/praktable.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libprakpp/include/praktable.hpp b/libprakpp/include/praktable.hpp
index 2cfa500..f00e7b9 100644
--- a/libprakpp/include/praktable.hpp
+++ b/libprakpp/include/praktable.hpp
@@ -472,7 +472,7 @@ public:
// Fills a specified column with the same value `v`
table &fill_column(const std::string &column, dtype v) {
- apply([&v](const std::vector<dtype>& _) -> dtype { return v; }, {}, column);
+ apply([&v](const std::vector<dtype>& _) -> dtype { return v; }, std::vector<std::string>{}, column);
return *this;
}
@@ -538,7 +538,7 @@ public:
dtype avg = col_avg(column);
for (auto it = begin(column); it != end(column); ++it)
accum += (*it - avg)*(*it - avg);
- return std::sqrt(accum);
+ return std::sqrt(accum / rows);
}
// takes columns [columns], calculates average and standard deviation for each row, puts them into `avg` and `stddev` and deleted original columns