MCPcopy
hub / github.com/dask/dask / interleave_none

Function interleave_none

dask/array/core.py:5768–5785  ·  view source on GitHub ↗

>>> interleave_none([0, None, 2, None], [1, 3]) (0, 1, 2, 3)

(a, b)

Source from the content-addressed store, hash-verified

5766
5767
5768def interleave_none(a, b):
5769 """
5770
5771 >>> interleave_none([0, None, 2, None], [1, 3])
5772 (0, 1, 2, 3)
5773 """
5774 result = []
5775 i = j = 0
5776 n = len(a) + len(b)
5777 while i + j < n:
5778 if a[i] is not None:
5779 result.append(a[i])
5780 i += 1
5781 else:
5782 result.append(b[j])
5783 i += 1
5784 j += 1
5785 return tuple(result)
5786
5787
5788def keyname(name, i, okey):

Callers 1

_vindex_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…