numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
array_repr(arr, max_line_width=None, precision=None, suppress_small=None)

Parameters

arr : ndarray

Input array.

max_line_width : int, optional

Inserts newlines if text is longer than :None:None:`max_line_width`. Defaults to numpy.get_printoptions()['linewidth'] .

precision : int, optional

Floating point precision. Defaults to numpy.get_printoptions()['precision'] .

suppress_small : bool, optional

Represent numbers "very close" to zero as zero; default is False. Very close is defined by precision: if the precision is 8, e.g., numbers smaller (in absolute value) than 5e-9 are represented as zero. Defaults to numpy.get_printoptions()['suppress'] .

Returns

string : str

The string representation of an array.

Return the string representation of an array.

See Also

array2string
array_str
set_printoptions

Examples

>>> np.array_repr(np.array([1,2]))
'array([1, 2])'
>>> np.array_repr(np.ma.array([0.]))
'MaskedArray([0.])'
>>> np.array_repr(np.array([], np.int32))
'array([], dtype=int32)'
>>> x = np.array([1e-6, 4e-7, 2, 3])
... np.array_repr(x, precision=6, suppress_small=True) 'array([0.000001, 0. , 2. , 3. ])'
See :

Back References

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

numpy.array_str numpy.core.arrayprint.array2string numpy.array2string

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/arrayprint.py#1519
type: <class 'function'>
Commit: