<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reindex(self):
 """Re-index this coarse graining to use squeezed indices. The output grouping is translated to use indices ``0..n``, where ``n`` is the number of micro indices in the coarse-graining. Re-indexing does not effect the state grouping, which is already index-independent. Returns: CoarseGrain: A new |CoarseGrain| object, indexed from ``0..n``. Example: CoarseGrain(partition=((0, 1),), grouping=(((0,), (1, 2)),)) """

        _map = dict(zip(self.micro_indices, reindex(self.micro_indices)))
        partition = tuple(
            tuple(_map[index] for index in group)
            for group in self.partition
        )
        return CoarseGrain(partition, self.grouping)