Turi Create
4.0
|
#include <core/storage/sframe_data/dataframe.hpp>
Public Member Functions | |
void | swap_column_order (size_t a, size_t b) |
dataframe_row_iterator & | operator++ () |
pre-increments to the next entry of the dataframe row-wise | |
dataframe_row_iterator & | operator++ (int) |
post-increments to the next entry of the dataframe row-wise | |
size_t | row () const |
Returns the index of the current row. | |
size_t | column () const |
Returns the index of the current column. | |
size_t | column_size () const |
Returns the number of columns. | |
size_t | row_size () const |
Returns the number of rows. | |
const std::string & | column_name () const |
Returns the name of the current column. | |
const std::string & | column_name (size_t idx) const |
Returns the name of an arbitrary column. | |
const std::vector< std::string > & | column_names () const |
Returns the list of all column names. | |
flex_type_enum | column_type () const |
Returns the type of the current column. | |
flex_type_enum | column_type (size_t idx) const |
Returns the type of an arbitrary column. | |
const std::vector< flex_type_enum > & | column_types () const |
Returns the list of all column types. | |
void | skip_rows (size_t num_rows_to_skip) |
bool | operator== (const dataframe_row_iterator &other) |
Returns true if both iterators are equal. | |
bool | operator!= (const dataframe_row_iterator &other) |
Returns true if both iterators are not equal. | |
const flexible_type & | operator* () |
Dereferences the iterator, returning a reference to the underlying flexible_type. | |
const flexible_type & | operator* () const |
Dereferences the iterator, returning a reference to the underlying flexible_type. | |
const flexible_type * | operator-> () |
Dereferences the iterator, returning a reference to the underlying flexible_type. | |
const flexible_type * | operator-> () const |
Dereferences the iterator, returning a reference to the underlying flexible_type. | |
Static Public Member Functions | |
static dataframe_row_iterator | begin (const dataframe_t &dt) |
Creates a begin iterator to the dataframe. | |
static dataframe_row_iterator | end (const dataframe_t &dt) |
Creates an end iterator to the dataframe. | |
The dataframe is a column-wise representation. This provides iteration over the dataframe in a row-wise representation. Incrementing the iterator advances the iterator element by element by across rows.
Usage:
Definition at line 205 of file dataframe.hpp.
void turi::dataframe_row_iterator::skip_rows | ( | size_t | num_rows_to_skip | ) |
Advances the iterator by this number of rows. Current column does not change. If the number of rows to skip causes the iterator to go past the end of the dataframe, the resultant iterator is equivalent to the end iterator of the dataframe.
|
inline |
Changes the column iterator ordering by swapping the indices of columns 'a' and columns 'b'. Should only be done on begin and end iterators. Iterators in the midst of iterating are not safe to be swapped.
Definition at line 248 of file dataframe.hpp.