MCPcopy Index your code
hub / github.com/numpy/numpy / set_printoptions

Function set_printoptions

numpy/_core/arrayprint.py:123–312  ·  view source on GitHub ↗

Set printing options. These options determine the way floating point numbers, arrays and other NumPy objects are displayed. Parameters ---------- precision : int or None, optional Number of digits of precision for floating point output (default 8). May be N

(precision=None, threshold=None, edgeitems=None,
                     linewidth=None, suppress=None, nanstr=None,
                     infstr=None, formatter=None, sign=None, floatmode=None,
                     *, legacy=None, override_repr=None)

Source from the content-addressed store, hash-verified

121
122@set_module('numpy')
123def set_printoptions(precision=None, threshold=None, edgeitems=None,
124 linewidth=None, suppress=None, nanstr=None,
125 infstr=None, formatter=None, sign=None, floatmode=None,
126 *, legacy=None, override_repr=None):
127 """
128 Set printing options.
129
130 These options determine the way floating point numbers, arrays and
131 other NumPy objects are displayed.
132
133 Parameters
134 ----------
135 precision : int or None, optional
136 Number of digits of precision for floating point output (default 8).
137 May be None if `floatmode` is not `fixed`, to print as many digits as
138 necessary to uniquely specify the value.
139 threshold : int, optional
140 Total number of array elements which trigger summarization
141 rather than full repr (default 1000).
142 To always use the full repr without summarization, pass `sys.maxsize`.
143 edgeitems : int, optional
144 Number of array items in summary at beginning and end of
145 each dimension (default 3).
146 linewidth : int, optional
147 The number of characters per line for the purpose of inserting
148 line breaks (default 75).
149 suppress : bool, optional
150 If True, always print floating point numbers using fixed point
151 notation, in which case numbers equal to zero in the current precision
152 will print as zero. If False, then scientific notation is used when
153 absolute value of the smallest number is < 1e-4 or the ratio of the
154 maximum absolute value to the minimum is > 1e3. The default is False.
155 nanstr : str, optional
156 String representation of floating point not-a-number (default nan).
157 infstr : str, optional
158 String representation of floating point infinity (default inf).
159 sign : string, either '-', '+', or ' ', optional
160 Controls printing of the sign of floating-point types. If '+', always
161 print the sign of positive values. If ' ', always prints a space
162 (whitespace character) in the sign position of positive values. If
163 '-', omit the sign character of positive values. (default '-')
164
165 .. versionchanged:: 2.0
166 The sign parameter can now be an integer type, previously
167 types were floating-point types.
168
169 formatter : dict of callables, optional
170 If not None, the keys should indicate the type(s) that the respective
171 formatting function applies to. Callables should return a string.
172 Types that are not specified (by their corresponding keys) are handled
173 by the default formatters. Individual types for which a formatter
174 can be set are:
175
176 - 'bool'
177 - 'int'
178 - 'timedelta' : a `numpy.timedelta64`
179 - 'datetime' : a `numpy.datetime64`
180 - 'float'

Callers 1

inject_strMethod · 0.90

Calls 1

_set_printoptionsFunction · 0.85

Tested by 1

inject_strMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…