class for impoting data from a csv file and allowing label string lookup like a data frame.
More...
|
| DataFrame (std::string datafile, size_t MaxNumber=1000000, char comment_char='#', char deliniator=',', std::string replace="\\N", std::function< bool(std::vector< T > &)> accept=[](std::vector< T > &v){return true;}) |
|
void | input (std::string datafile, size_t MaxNumber=1000000, char comment_char='#', char deliniator=',', std::string replace="\\N", std::function< bool(std::vector< T > &)> accept=[](std::vector< T > &v){return true;}) |
|
void | pop (std::string colname) |
| remove a column
|
|
std::vector< T > & | operator[] (const std::string &label) |
| returns column by name
|
|
void | add_column (const std::string &name, const std::vector< T > &vec) |
| add a column to the data frame. This does a copy.
|
|
std::vector< T > & | operator[] (int i) |
| returns column by number
|
|
std::vector< std::string > | labels () const |
| returns labels of the columns from the data file
|
|
void | sortby (std::string name) |
|
void | shuffle (Utilities::RandomNumbers_NR &ran) |
|
size_t | number_of_rows () |
|
size_t | number_of_columns () |
|
template<typename T>
class Utilities::DataFrame< T >
class for impoting data from a csv file and allowing label string lookup like a data frame.
The accept function can be used to limit the amount of data added. If there is an object, a, used to make this selection this can be done like [&a](str::vector<T> &v}{return a.itsok(v[3],v[4]);} where v corresponds to a row in the data file in order.
Entries that throw an exception when converting to T are replaced with -500