numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
_block_check_depths_match(arrays, parent_index=[])

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 arrays

The arrays to check

parent_index : list of int

The full index of :None:None:`arrays` within the nested lists passed to _block_check_depths_match at the top of the recursion.

Returns

first_index : list of int

The full index of an element from the bottom of the nesting in :None:None:`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 : int

The maximum of the ndims of the arrays nested in :None:None:`arrays`.

final_size: int

The number of elements in the final array. This is used the motivate the choice of algorithm used using benchmarking wisdom.

Recursive function checking that the depths of nested lists in :None:None:`arrays` all match. Mismatch raises a ValueError as described in the block docstring below.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.core.shape_base._block_check_depths_match

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/core/shape_base.py#452
type: <class 'function'>
Commit: