From 5ee716791bf7a8ca74c1670a6887a53ab92141f6 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Mon, 14 Apr 2025 00:34:52 +0300 Subject: added 218, 226, 234, 240 --- libprakpp/include/praktable.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libprakpp/include/praktable.hpp') 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 { return v; }, {}, column); + apply([&v](const std::vector& _) -> dtype { return v; }, std::vector{}, 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 -- cgit v1.2.3-70-g09d2