Turi Create
4.0
|
#include <toolkits/util/indexed_sframe_tools.hpp>
Public Member Functions | |
indexed_column_groupby (std::shared_ptr< sarray< flexible_type > > src_column, std::shared_ptr< sarray< flexible_type > > dest_column, bool sort, bool uniquify) | |
const std::vector< size_t > & | dest_group (size_t src_value) const |
Creates an in-memory group lookup table from one integer column to another. In this representation, all the items in one column associated with a given value in the other column can be retrieved by that value.
Definition at line 41 of file indexed_sframe_tools.hpp.
turi::indexed_column_groupby::indexed_column_groupby | ( | std::shared_ptr< sarray< flexible_type > > | src_column, |
std::shared_ptr< sarray< flexible_type > > | dest_column, | ||
bool | sort, | ||
bool | uniquify | ||
) |
Builds a mapping of integer values in src_column to a vector of all the associated values in dest_column. This can be queried using dest_group.
If sort is true, then the returned elements are sorted.
If uniquify is true, then the returned vector has at most one of any given element.
const std::vector<size_t>& turi::indexed_column_groupby::dest_group | ( | size_t | src_value | ) | const |
Returns a vector with all the associated values in dest_column that have src_value in the corresponding location of src_column. If src_value does not appear in src_column, then the returned vector is empty.