MCPcopy Create free account
hub / github.com/numpy/numpy / _block_format_index

Function _block_format_index

numpy/core/shape_base.py:469–474  ·  view source on GitHub ↗

Convert a list of indices ``[0, 1, 2]`` into ``"arrays[0][1][2]"``.

(index)

Source from the content-addressed store, hash-verified

467
468
469def _block_format_index(index):
470 """
471 Convert a list of indices ``[0, 1, 2]`` into ``"arrays[0][1][2]"``.
472 """
473 idx_str = ''.join('[{}]'.format(i) for i in index if i is not None)
474 return 'arrays' + idx_str
475
476
477def _block_check_depths_match(arrays, parent_index=[]):

Callers 2

_block_setupFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected