Return the string representation of an array.
Parameters: | arr : ndarray
max_line_width : int, optional
precision : int, optional
suppress_small : bool, optional
|
---|---|
Returns: | string : str
|
See also
array_str, array2string, 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. ])'