def reindex(self, kdims=[], force=False):
        old_kdims = [d.name for d in self.kdims]
        if not len(kdims):
            kdims = [d for d in old_kdims
                     if not len(set(self.dimension_values(d))) == 1]
        indices = [self.get_dimension_index(el) for el in kdims]

        keys = [tuple(k[i] for i in indices) for k in self.data.keys()]
        reindexed_items = OrderedDict(
            (k, v) for (k, v) in zip(keys, self.data.values()))
        reduced_dims = set([d.name for d in self.kdims]).difference(kdims)
        dimensions = [self.get_dimension(d) for d in kdims
                      if d not in reduced_dims]

        if len(set(keys)) != len(keys) and not force:
            raise Exception("Given dimension labels not sufficient"
                            "to address all values uniquely")

        if len(keys):
            cdims = {self.get_dimension(d): self.dimension_values(d)[0] for d in reduced_dims}
        else:
            cdims = {}
        with item_check(indices == sorted(indices)):
            return self.clone(reindexed_items, kdims=dimensions,
                              cdims=cdims)
Create a new object with a re-ordered or reduced set of key
dataset/ETHPy150Open ioam/holoviews/holoviews/core/ndmapping.py/MultiDimensionalMapping.reindex