Esempio n. 1
0
 def get_col_map(self, group_by: tp.GroupByLike = None) -> tp.ColMap:
     """Get group-aware column map."""
     if not self.wrapper.grouper.is_grouped(group_by=group_by):
         return self.col_map
     col_arr = self.get_col_arr(group_by=group_by)
     columns = self.wrapper.get_columns(group_by=group_by)
     return nb.col_map_nb(col_arr, len(columns))
Esempio n. 2
0
    def col_map(self) -> tp.ColMap:
        """Column map.

        More flexible than `ColumnMapper.col_range`.
        More suited for mapped arrays."""
        return nb.col_map_nb(self.col_arr, len(self.wrapper.columns))