bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / _core / shape_base / _block_check_depths_match
function
numpy._core.shape_base:_block_check_depths_match
source: build-install/usr/lib/python3.14/site-packages/numpy/_core/shape_base.py :557
Signature
def _block_check_depths_match ( arrays , parent_index = [] ) Summary
Recursive function checking that the depths of nested lists in arrays all match. Mismatch raises a ValueError as described in the block docstring below.
Extended Summary
The entire index (rather than just the depth) needs to be calculated for each innermost list, in case an error needs to be raised, so that the index of the offending list can be printed as part of the error.
Parameters
arrays: nested list of arraysThe arrays to check
parent_index: list of intThe full index of
arrayswithin the nested lists passed to _block_check_depths_match at the top of the recursion.
Returns
first_index: list of intThe full index of an element from the bottom of the nesting in
arrays. If any element at the bottom is an empty list, this will refer to it, and the last index along the empty axis will be None.max_arr_ndim: intThe maximum of the ndims of the arrays nested in
arrays.: final_size: intThe number of elements in the final array. This is used the motivate the choice of algorithm used using benchmarking wisdom.
Aliases
-
numpy._core.shape_base._block_check_depths_match