Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.array_str

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

Return a string representation of the data in an array.

The data in the array is returned as a single string. This function issimilar toarray_repr, the difference being thatarray_repr alsoreturns 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 thanmax_line_width. Thedefault is, indirectly, 75.

precision:int, optional

Floating point precision. Default is the current printing precision(usually 8), which can be altered usingset_printoptions.

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 aszero.

Examples

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

Previous topic

numpy.array_repr

Next topic

numpy.format_float_positional

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp