bolt/spark/shapes.py
def reshape(self, *shape):
        """
        Reshape just the keys of a BoltArraySpark, returning a
        new BoltArraySpark.

        Parameters
        ----------
        shape : tuple
              New proposed axes.
        """
        new = argpack(shape)
        old = self.shape
        isreshapeable(new, old)

        if new == old:
            return self._barray

        def f(k):
            return unravel_index(ravel_multi_index(k, old), new)

        newrdd = self._barray._rdd.map(lambda kv: (f(kv[0]), kv[1]))
        newsplit = len(new)
        newshape = new + self._barray.values.shape

        return BoltArraySpark(newrdd, shape=newshape, split=newsplit).__finalize__(self._barray)
def reshape(self, *shape):
        new = argpack(shape)
        old = self.shape
        isreshapeable(new, old)

        if new == old:
            return self._barray

        def f(k):
            return unravel_index(ravel_multi_index(k, old), new)

        newrdd = self._barray._rdd.map(lambda kv: (f(kv[0]), kv[1]))
        newsplit = len(new)
        newshape = new + self._barray.values.shape

        return BoltArraySpark(newrdd, shape=newshape, split=newsplit).__finalize__(self._barray)
def reshape ( self , * shape ) : new = argpack ( shape ) old = self . shape isreshapeable ( new , old ) if new == old : return self . _barray def f ( k ) : return unravel_index ( ravel_multi_index ( k , old ) , new ) newrdd = self . _barray . _rdd . map ( lambda kv : ( f ( kv [ 0 ] ) , kv [ 1 ] ) ) newsplit = len ( new ) newshape = new + self . _barray . values . shape return BoltArraySpark ( newrdd , shape = newshape , split = newsplit ) . __finalize__ ( self . _barray )
Reshape just the keys of a BoltArraySpark, returning a
        new BoltArraySpark.

        Parameters
        ----------
        shape : tuple
              New proposed axes.
Reshape just the keys of a BoltArraySpark returning a new BoltArraySpark .