MCPcopy Create free account
hub / github.com/Lauriat/funct / roll

Method roll

funct/Array.py:322–328  ·  view source on GitHub ↗

Rolls the elements of the Array.

(self, n, inplace=False)

Source from the content-addressed store, hash-verified

320 return self
321
322 def roll(self, n, inplace=False):
323 """ Rolls the elements of the Array. """
324 n = n % self.size
325 a = self[-n:] + self[:-n]
326 if inplace:
327 return self.__setinplace(a, inplace)
328 return a
329
330 def roll_(self, n):
331 """ Rolls the elements of the Array in-place. """

Callers 1

testMethod · 0.95

Calls 1

__setinplaceMethod · 0.95

Tested by 1

testMethod · 0.76