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

Function interleave_none

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

5563
5564
5565def interleave_none(a, b):
5566 """
5567
5568 >>> interleave_none([0, None, 2, None], [1, 3])
5569 (0, 1, 2, 3)
5570 """
5571 result = []
5572 i = j = 0
5573 n = len(a) + len(b)
5574 while i + j < n:
5575 if a[i] is not None:
5576 result.append(a[i])
5577 i += 1
5578 else:
5579 result.append(b[j])
5580 i += 1
5581 j += 1
5582 return tuple(result)
5583
5584
5585def keyname(name, i, okey):

Callers 1

_vindex_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected