MCPcopy
hub / github.com/nitrain/nitrain / flatten_extend

Function flatten_extend

nitrain/samplers/slice.py:69–73  ·  view source on GitHub ↗
(matrix)

Source from the content-addressed store, hash-verified

67
68def create_slices(x, axis):
69 def flatten_extend(matrix):
70 flat_list = []
71 for row in matrix:
72 flat_list.extend(row)
73 return flat_list
74
75 if isinstance(x[0], list):
76 return [create_slices([x[i][j] for i in range(len(x))], axis) for j in range(len(x[0]))]

Callers 1

create_slicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected