(self, table, selection)
return dict(zip(items, ids))
Returns mappings of ids (be it row id or string) to indices in tables
Returns mappings of ids (be it row id or string) to indices in tables
Returns mappings of ids ( be it row id or string ) to indices in tables
def get_indices(self, table, selection):
        """Returns mappings of ids (be it row id or string) to indices in tables"""
        if self.selected_feature == IDENTITY_STR:
            items = table.ids
            ids = range(len(table))
        elif self.selected_feature == EQUALITY_STR:
            items, ids = np.unique(self._hashes(table), return_index=True)
        else:
            items = getattr(table[:, self.selected_feature], 'metas')
            if self.output_duplicates and selection:
                items, inverse = np.unique(items, return_inverse=True)
                ids = [np.nonzero(inverse == idx)[0] for idx in range(len(items))]
            else:
                items, ids = np.unique(items, return_index=True)

        if selection:
            return {item: idx for item, idx in zip(items, ids)
                    if item in self.selected_items}

        return dict(zip(items, ids))
def get_indices ( self , table , selection ) : if self . selected_feature == IDENTITY_STR : items = table . ids ids = range ( len ( table ) ) elif self . selected_feature == EQUALITY_STR : items , ids = np . unique ( self . _hashes ( table ) , return_index = True ) else : items = getattr ( table [ : , self . selected_feature ] , 'metas' ) if self . output_duplicates and selection : items , inverse = np . unique ( items , return_inverse = True ) ids = [ np . nonzero ( inverse == idx ) [ 0 ] for idx in range ( len ( items ) ) ] else : items , ids = np . unique ( items , return_index = True ) if selection : return { item : idx for item , idx in zip ( items , ids ) if item in self . selected_items } return dict ( zip ( items , ids ) )