MCPcopy Create free account
hub / github.com/dask/dask / expander

Function expander

dask/array/slicing.py:707–713  ·  view source on GitHub ↗

Create a function to insert value at many locations in sequence. >>> expander([0, 2])(['a', 'b', 'c'], 'z') ('z', 'a', 'z', 'b', 'c')

(where)

Source from the content-addressed store, hash-verified

705
706
707def expander(where):
708 """Create a function to insert value at many locations in sequence.
709
710 >>> expander([0, 2])(['a', 'b', 'c'], 'z')
711 ('z', 'a', 'z', 'b', 'c')
712 """
713 return _expander(tuple(where))
714
715
716def new_blockdim(dim_shape, lengths, index):

Callers 3

expandMethod · 0.90
_layerMethod · 0.90
slice_with_newaxesFunction · 0.85

Calls 1

_expanderFunction · 0.85

Tested by

no test coverage detected