numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturns
_pad_simple(array, pad_width, fill_value=None)

Parameters

array : ndarray

Array to grow.

pad_width : sequence of tuple[int, int]

Pad width on both sides for each dimension in :None:None:`arr`.

fill_value : scalar, optional

If provided the padded area is filled with this value, otherwise the pad area left undefined.

Returns

padded : ndarray

The padded array with the same dtype as`array`. Its order will default to C-style if array is not F-contiguous.

original_area_slice : tuple

A tuple of slices pointing to the area of the original array.

Pad array on all sides with either a single value or undefined values.

Examples

See :

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/lib/arraypad.py#86
type: <class 'function'>
Commit: