Vince's CSV Parser
|
Class for calculating statistics from CSV files and in-memory sources. More...
#include <csv_stat.hpp>
Public Types | |
using | FreqCount = std::unordered_map< std::string, size_t > |
using | TypeCount = std::unordered_map< DataType, size_t > |
Public Member Functions | |
std::vector< long double > | get_mean () const |
Return current means. | |
std::vector< long double > | get_variance () const |
Return current variances. | |
std::vector< long double > | get_mins () const |
Return current mins. | |
std::vector< long double > | get_maxes () const |
Return current maxes. | |
std::vector< FreqCount > | get_counts () const |
Get counts for each column. | |
std::vector< TypeCount > | get_dtypes () const |
Get data type counts for each column. | |
std::vector< std::string > | get_col_names () const |
CSVStat (csv::string_view filename, CSVFormat format=CSVFormat::guess_csv()) | |
Calculate statistics for an arbitrarily large file. More... | |
CSVStat (std::stringstream &source, CSVFormat format=CSVFormat()) | |
Calculate statistics for a CSV stored in a std::stringstream. | |
Class for calculating statistics from CSV files and in-memory sources.
Example
Definition at line 18 of file csv_stat.hpp.
csv::CSVStat::CSVStat | ( | csv::string_view | filename, |
CSVFormat | format = CSVFormat::guess_csv() |
||
) |
Calculate statistics for an arbitrarily large file.
When this constructor is called, CSVStat will process the entire file iteratively. Once finished, methods like get_mean(), get_counts(), etc... can be used to retrieve statistics.
Definition at line 13 of file csv_stat.cpp.