@@ -253,37 +253,59 @@ enabling the new 1.13 "legacy" printing mode. This is enabled by calling
253
253
254
254
In summary, the major changes are:
255
255
256
- * The ``repr `` of float arrays often omits a whitespace previously printed
257
- in the sign position. See the new ``sign `` option to ``np.set_printoptions ``.
258
- * Floating-point arrays and scalars use a new algorithm for decimal
259
- representations, giving the shortest unique representation. This will
260
- usually shorten ``float16 `` fractional output, and sometimes ``float32 `` and
261
- ``float128 `` output. ``float64 `` should be unaffected. See the new
262
- ``floatmode `` option to ``np.set_printoptions ``.
263
- * Float arrays printed in scientific notation no longer use fixed-precision,
264
- and now instead show the shortest unique representation.
265
- * The ``str `` of floating-point scalars is no longer truncated in python2.
266
- * Non-finite complex scalars print like ``nanj `` instead of ``nan*j ``.
256
+ * For floating-point types:
257
+
258
+ * The ``repr `` of float arrays often omits a space previously printed
259
+ in the sign position. See the new ``sign `` option to ``np.set_printoptions ``.
260
+ * Floating-point arrays and scalars use a new algorithm for decimal
261
+ representations, giving the shortest unique representation. This will
262
+ usually shorten ``float16 `` fractional output, and sometimes ``float32 `` and
263
+ ``float128 `` output. ``float64 `` should be unaffected. See the new
264
+ ``floatmode `` option to ``np.set_printoptions ``.
265
+ * Float arrays printed in scientific notation no longer use fixed-precision,
266
+ and now instead show the shortest unique representation.
267
+ * The ``str `` of floating-point scalars is no longer truncated in python2.
268
+
269
+ * For other data types:
270
+
271
+ * Non-finite complex scalars print like ``nanj `` instead of ``nan*j ``.
272
+ * ``NaT `` values in datetime arrays are now properly aligned.
273
+ * Arrays and scalars of ``np.void `` datatype are now printed using hex
274
+ notation.
275
+
276
+ * For line-wrapping:
277
+
278
+ * The "dtype" part of ndarray reprs will now be printed on the next line
279
+ if there isn't space on the last line of array output.
280
+ * The ``linewidth `` format option is now always respected.
281
+ The `repr ` or `str ` of an array will never exceed this, unless a single
282
+ element is too wide.
283
+ * All but the last line of array strings will contain the same number of
284
+ elements.
285
+ * The last line of an array string will never have more elements than earlier
286
+ lines.
287
+
288
+ * For summarization (the use of ``... `` to shorten long arrays):
289
+
290
+ * A trailing comma is no longer inserted for ``str ``.
291
+ Previously, ``str(np.arange(1001)) `` gave
292
+ ``'[ 0 1 2 ..., 998 999 1000]' ``, which has an extra comma.
293
+ * For arrays of 2-D and beyond, when ``... `` is printed on its own line in
294
+ order to summarize any but the last axis, newlines are now appended to that
295
+ line to match its leading newlines and a trailing space character is
296
+ removed.
297
+
267
298
* ``MaskedArray `` arrays now separate printed elements with commas, always
268
299
print the dtype, and correctly wrap the elements of long arrays to multiple
269
300
lines. If there is more than 1 dimension, the array attributes are now
270
301
printed in a new "left-justified" printing style.
271
- * ``NaT `` values in datetime arrays are now properly aligned.
272
- * Arrays and scalars of `` np.void `` datatype are now printed using hex notation .
302
+ * ``recarray `` arrays no longer print a trailing space before their dtype, and
303
+ wrap to the right number of columns .
273
304
* 0d arrays no longer have their own idiosyncratic implementations of ``str ``
274
305
and ``repr ``. The ``style `` argument to ``np.array2string `` is deprecated.
275
306
* Arrays of ``bool `` datatype will omit the datatype in the ``repr ``.
276
- * The "dtype" part of ndarray reprs will now be printed on the next line
277
- if there isn't space on the last line of array output.
278
307
* User-defined ``dtypes `` (subclasses of ``np.generic ``) now need to
279
308
implement ``__str__ `` and ``__repr__ ``.
280
- * The ``... `` used to summarize long arrays now omits a trailing comma for
281
- ``str ``. Previously, ``str(np.arange(1001)) `` gave
282
- ``'[ 0 1 2 ..., 998 999 1000]' ``, which has an extra comma.
283
- * When a summarization ``... `` would be printed on its own line, e.g., for
284
- summarization along any ndarray dimension but the last, a trailing
285
- whitespace is now removed and trailing newlines added to match
286
- the leading newlines.
287
309
288
310
Some of these changes are described in more detail below.
289
311
0 commit comments