summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-03-06 23:15:35 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-03-06 23:15:35 +0000
commit819578a1b2d5f9adf9ab6719e8b9b425c5ca7e00 (patch)
treee0dfce89c9c9fa810169d00979939a6218ceb842 /numpy/core/arrayprint.py
parent2ce56bc1c3faa7d2e9e4ba5e64e2a8bdd5bb5313 (diff)
downloadnumpy-819578a1b2d5f9adf9ab6719e8b9b425c5ca7e00.tar.gz
Apply Tim's code-checker tests except for white-space-only changes.
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r--numpy/core/arrayprint.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
index 4e5db082a..a78601188 100644
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -79,7 +79,7 @@ def set_printoptions(precision=None, threshold=None, edgeitems=None,
linewidth the number of characters per line for the purpose of inserting
line breaks.
(default 75)
- supress Boolean value indicating whether or not suppress printing
+ suppress Boolean value indicating whether or not suppress printing
of small floating point values using scientific notation
(default False)
"""
@@ -95,7 +95,7 @@ def set_printoptions(precision=None, threshold=None, edgeitems=None,
if (precision is not None):
_float_output_precision = precision
if (suppress is not None):
- _float_output_supress_small = not not suppress
+ _float_output_suppress_small = not not suppress
return
def get_printoptions():
@@ -139,8 +139,6 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ',
else:
summary_insert = ""
data = a.ravel()
-
- items_per_line = a.shape[-1]
try:
format_function = a._format
@@ -168,9 +166,9 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ',
format = "%s"
format_function = lambda x, f = format: repr(x)
else:
- format = '%s'
- format_function = lambda x, f = format: format % str(x)
-
+ format = '%s'
+ format_function = lambda x, f = format: format % str(x)
+
next_line_prefix = " " # skip over "["
next_line_prefix += " "*len(prefix) # skip over array(
@@ -252,7 +250,7 @@ def _formatArray(a, format_function, rank, max_line_len,
s += _formatArray(a[i], format_function, rank-1, max_line_len,
" " + next_line_prefix, separator, edge_items,
summary_insert)
- s = s.rstrip()+ sep.rstrip() + '\n'*max(rank-1,1)
+ s = s.rstrip() + sep.rstrip() + '\n'*max(rank-1,1)
if summary_insert1:
s += next_line_prefix + summary_insert1 + "\n"