Exemplo n.º 1
0
    def _make_final_rowindex(self) -> Optional[core.RowIndex]:
        """
        Construct the "final" RowIndex object.

        If the source Frame is a view, then the returned RowIndex is an
        uplifted version of the "source" RowIndex. Otherwise the final RowIndex
        is the same object as the source RowIndex. The returned value may also
        be None indicating absense of any RowIndex.
        """
        _dt = self._engine.dt.internal
        ri_source = self._make_source_rowindex()
        ri_target = _dt.rowindex

        if self._inverse:
            if ri_source is None:
                return core.rowindex_from_slice(0, 0, 0)
            elif ri_target is None:
                return ri_source.inverse(_dt.nrows)
            else:
                return ri_source.inverse(_dt.nrows).uplift(ri_target)

        if ri_source is None:
            return ri_target
        else:
            if ri_target is None:
                return ri_source
            else:
                return ri_source.uplift(ri_target)
Exemplo n.º 2
0
 def _make_source_rowindex(self):
     return core.rowindex_from_slice(*self._triple)