6 #include <unordered_map>
20 using FreqCount = std::unordered_map<std::string, size_t>;
21 using TypeCount = std::unordered_map<DataType, size_t>;
23 std::vector<long double>
get_mean()
const;
25 std::vector<long double>
get_mins()
const;
26 std::vector<long double>
get_maxes()
const;
30 std::vector<std::string> get_col_names()
const {
39 std::vector<long double> rolling_means;
40 std::vector<long double> rolling_vars;
41 std::vector<long double> mins;
42 std::vector<long double> maxes;
43 std::vector<FreqCount> counts;
44 std::vector<TypeCount> dtypes;
45 std::vector<long double> n;
48 void variance(
const long double&,
const size_t&);
49 void count(
CSVField&,
const size_t&);
50 void min_max(
const long double&,
const size_t&);
51 void dtype(
CSVField&,
const size_t&);
55 void calc_worker(
const size_t&);
58 std::deque<CSVRow> records = {};
Data type representing individual CSV values.
Main class for parsing CSVs from files and in-memory sources.
std::vector< std::string > get_col_names() const
Return the CSV's column names as a vector of strings.
Class for calculating statistics from CSV files and in-memory sources.
std::vector< long double > get_mean() const
Return current means.
std::vector< long double > get_variance() const
Return current variances.
CSVStat(csv::string_view filename, CSVFormat format=CSVFormat::guess_csv())
Calculate statistics for an arbitrarily large file.
std::vector< long double > get_mins() const
Return current mins.
std::vector< TypeCount > get_dtypes() const
Get data type counts for each column.
std::vector< long double > get_maxes() const
Return current maxes.
std::vector< FreqCount > get_counts() const
Get counts for each column.
Defines functionality needed for basic CSV parsing.
The all encompassing namespace.
nonstd::string_view string_view
The string_view class used by this library.