45 std::shared_ptr<std::vector<std::string>> index;
79 void add(
const T& value,
const std::string& idx) {
80 data.push_back(value);
81 index->push_back(idx);
105 T at(
const std::string& idx)
const;
182 const std::shared_ptr<std::vector<std::string>>&
getIndex()
const {
200 std::vector<std::string> res{};
201 for (
auto _ : data) {
202 res.push_back(std::to_string(_));
Generic one-dimensional container of values with optional string index.
std::vector< T > quartiles() const
Returns the first, second (median), and third quartiles.
T min() const
Returns the minimum value in the series.
Series(const std::string &colName)
Constructs a Series with a given column name.
const std::shared_ptr< std::vector< std::string > > & getIndex() const
Accessor to the shared index vector.
std::vector< std::string > to_string_vec()
Returns a vector of stringified values.
T at(const std::string &idx) const
Label-based access to a value.
const std::string & getName() const
Returns the series name.
double mean() const
Computes the arithmetic mean of the series.
T iat(size_t idx) const
Positional access to the i-th element.
void print() const
Prints all stored values to std::cout.
Series()
Default constructor.
double stddev() const
Computes the (population) standard deviation of the series.
T max() const
Returns the maximum value in the series.
void add(const T &value, const std::string &idx)
Appends a value with an associated index label.
size_t size() const
Returns the number of elements stored in the series.
void add(const T &value)
Appends a value at the end of the series (without index).
std::vector< T > to_vec()
Returns a copy of the underlying data as a std::vector.
Hash specialization for SymbolId<Tag>.
double T(double x)
Wilson coefficient T(x).