template<typename T>
StdDataFrame<T>
value_counts (const char *col_name) const;
|
It counts the unique values in the named column.
It returns a StdDataFrame of following specs:
- The index is of type T and contains all unique values in the named column.
- There is only one column named "counts" of type size_type that contains the count for each index row.
For this method to compile and work, 3 conditions must be met:
- Type T must be hashable. If this is a user defined type, you must enable and specialize std::hash.
- The equality operator (==) must be well defined for type T.
- Type T must match the actual type of the named column.
Of course, if you never call this method in your application, you need not be worried about these conditions.
|
T: Type of the named column
|