4#include <unordered_map>
33std::ostream&
operator<<(std::ostream& os,
const std::vector<std::string>& vec);
40std::ostream&
operator<<(std::ostream& os,
const std::array<int,2>& vec);
64 std::unordered_map<std::string, std::shared_ptr<void>> columns_map;
73 std::vector<int> size;
86 std::array<int, 2>
shape = {0,0};
105 template <
typename T>
121 template <
typename T>
135 template <
typename T>
136 T iat(
size_t row,
const std::string& colName)
const;
153 template <
typename T>
154 T at(
const std::string& idxValue,
const std::string& colName)
const;
166 template <
typename T>
223 template <
typename T>
245 template <
typename T>
260 void setIndex(
const std::vector<std::string>& newIndex);
269 const std::vector<std::string>&
getIndex()
const;
285 void to_csv(
const std::string& filename);
299#include "DataFrame.tpp"
Configuration holder for CSV import/export of a DataFrame.
std::ostream & operator<<(std::ostream &os, const std::vector< std::string > &vec)
Stream output helper for a vector of strings.
Simple one-dimensional data container with basic statistics.
Simple column-oriented data structure with basic analysis utilities.
void describeColumn(const std::string &colName) const
Prints a statistical summary for a single numeric column.
void print() const
Prints the DataFrame to std::cout in a tabular format.
DataFrame tail(size_t n=5) const
Returns a new DataFrame with the last n rows.
const std::vector< std::string > & getIndex() const
Returns the current index labels.
void addValueToColumn(const std::string &colName, const T &value)
Appends a value to an existing column.
DataFrame head(size_t n=5) const
Returns a new DataFrame with the first n rows.
Series< T > & operator[](const std::string &colName)
Accessor for a column as a modifiable Series<T>.
DataFrame()
Default constructor.
T at(const std::string &idxValue, const std::string &colName) const
Label-based access to a cell (index label, column name).
void _set_csv_options(const CSVOptions &options)
Internal helper to set CSV options from an external source.
void describe() const
Prints a summary for all numeric columns.
std::array< int, 2 > shape
Shape of the DataFrame: {nRows, nCols}.
Series< T > getColumn(const std::string &colName) const
Returns a copy of a column as a Series<T>.
void addColumn(const std::string &colName)
Adds a new empty column of type T.
size_t getRowCount() const
Returns the number of rows in the DataFrame.
const std::vector< std::string > & getColumnNames() const
Returns the list of column names.
void to_csv(const std::string &filename)
Serializes the DataFrame to a CSV file.
std::vector< std::string > index
Optional index labels for the rows (if set).
std::vector< std::string > columns
List of column names, in insertion order.
void setIndex(const std::vector< std::string > &newIndex)
Sets the index labels for all rows.
T iat(size_t row, const std::string &colName) const
Positional access to a cell (row index, column name).
Generic one-dimensional container of values with optional string index.
Hash specialization for SymbolId<Tag>.
double T(double x)
Wilson coefficient T(x).
Options describing how to interpret or write CSV data.