diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-12-06 00:04:25 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-12-06 00:04:25 -0800 |
commit | 1d6be8331a3d22ae5ff6639b264b125f3bb14bd6 (patch) | |
tree | 501a7b16c4fe202df59fec83857ccb04e89d5be8 /numpy/core/arrayprint.py | |
parent | 82deb85915b40e19060186f47396328fcaa85b8f (diff) | |
download | numpy-1d6be8331a3d22ae5ff6639b264b125f3bb14bd6.tar.gz |
MAINT: Never add the newline in _formatArray that is always discarded
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r-- | numpy/core/arrayprint.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index 641c2f94f..a5d5f86b3 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -450,7 +450,7 @@ def _array2string(a, options, separator=' ', prefix=""): lst = _formatArray(a, format_function, a.ndim, options['linewidth'], next_line_prefix, separator, options['edgeitems'], - summary_insert, options['legacy'])[:-1] + summary_insert, options['legacy']) return lst @@ -633,7 +633,7 @@ def _formatArray(a, format_function, rank, max_line_len, next_line_prefix, """ if rank == 0: - return format_function(a[()]) + '\n' + return format_function(a[()]) show_summary = summary_insert and 2*edge_items < len(a) @@ -664,7 +664,7 @@ def _formatArray(a, format_function, rank, max_line_len, next_line_prefix, word = format_function(a[-1]) s, line = _extendLine(s, line, word, max_line_len, next_line_prefix) - s += line + "]\n" + s += line + "]" s = '[' + s[len(next_line_prefix):] else: s = '[' @@ -695,7 +695,7 @@ def _formatArray(a, format_function, rank, max_line_len, next_line_prefix, s += next_line_prefix s += _formatArray(a[-1], format_function, rank-1, max_line_len, " " + next_line_prefix, separator, edge_items, - summary_insert, legacy).rstrip()+']\n' + summary_insert, legacy).rstrip()+']' return s |