numpy.array_str

numpy.array_str(a, max_line_width=None, precision=None, suppress_small=None)

Return a string representation of an array.

Parameters:

a : ndarray

Input array.

max_line_width : int, optional

Inserts newlines if text is longer than max_line_width.

precision : int, optional

If a is float, precision sets loating point precision.

suppress_small : boolean, optional

Represent very small numbers as zero.

See also

array2string, array_repr

Examples

>>> np.array_str(np.arange(3))
>>> '[0 1 2]'

Previous topic

numpy.array_repr

Next topic

numpy.memmap

This Page

Quick search