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

Function deepfirst

dask/array/core.py:5459–5468  ·  view source on GitHub ↗

First element in a nested list >>> deepfirst([[[1, 2], [3, 4]], [5, 6], [7, 8]]) 1

(seq)

Source from the content-addressed store, hash-verified

5457
5458
5459def deepfirst(seq):
5460 """First element in a nested list
5461
5462 >>> deepfirst([[[1, 2], [3, 4]], [5, 6], [7, 8]])
5463 1
5464 """
5465 if not isinstance(seq, (list, tuple)):
5466 return seq
5467 else:
5468 return deepfirst(seq[0])
5469
5470
5471def shapelist(a):

Callers 3

chunks_from_arraysFunction · 0.85
concatenate3Function · 0.85
concatenate_axesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected