MCPcopy
hub / github.com/dask/dask / reshapelist

Function reshapelist

dask/core.py:537–547  ·  view source on GitHub ↗

Reshape iterator to nested shape >>> reshapelist((2, 3), range(6)) [[0, 1, 2], [3, 4, 5]]

(shape, seq)

Source from the content-addressed store, hash-verified

535
536
537def reshapelist(shape, seq):
538 """Reshape iterator to nested shape
539
540 >>> reshapelist((2, 3), range(6))
541 [[0, 1, 2], [3, 4, 5]]
542 """
543 if len(shape) == 1:
544 return list(seq)
545 else:
546 n = int(len(seq) / shape[0])
547 return [reshapelist(shape[1:], part) for part in toolz.partition(n, seq)]

Callers 2

transposelistFunction · 0.90
concatenate_shapedFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…