Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé
Module « numpy »

Fonction array_str - module numpy

Signature de la fonction array_str

def array_str(a, max_line_width=None, precision=None, suppress_small=None) 

Description

help(numpy.array_str)

Return a string representation of the data in an array.

The data in the array is returned as a single string.  This function is
similar to `array_repr`, the difference being that `array_repr` also
returns information on the kind of array and its data type.

Parameters
----------
a : ndarray
    Input array.
max_line_width : int, optional
    Inserts newlines if text is longer than `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']``.

See Also
--------
array2string, array_repr, set_printoptions

Examples
--------
>>> import numpy as np
>>> np.array_str(np.arange(3))
'[0 1 2]'



Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé