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

Function interleave_none

dask/array/core.py:5763–5780  ·  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

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

Callers 1

_vindex_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected