diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-12-01 02:22:55 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-12-01 02:22:55 +0000 |
commit | 158f48745d77993638bfe82fc1bdfddcf24cacbf (patch) | |
tree | fc04d058df40081be147ddeff68e4f8b038c405e /scipy/base/arrayprint.py | |
parent | c9af94ca078be1fa0d7a3528f57ab2a5b295fcc4 (diff) | |
download | numpy-158f48745d77993638bfe82fc1bdfddcf24cacbf.tar.gz |
Basic record type now works.
Diffstat (limited to 'scipy/base/arrayprint.py')
-rw-r--r-- | scipy/base/arrayprint.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/scipy/base/arrayprint.py b/scipy/base/arrayprint.py index 6124a1bc2..4f3352ddd 100644 --- a/scipy/base/arrayprint.py +++ b/scipy/base/arrayprint.py @@ -140,26 +140,24 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ', summary_insert = "" data = a.ravel() - - items_per_line = a.shape[-1] try: format_function = a._format except AttributeError: - type = a.dtype - if issubclass(type, _nt.bool): + dtype = a.dtype + if issubclass(dtype, _nt.bool): format = "%s" format_function = lambda x, f = format: format % x - if issubclass(type, _nt.integer): + if issubclass(dtype, _nt.integer): max_str_len = max(len(str(max_reduce(data))), len(str(min_reduce(data)))) format = '%' + str(max_str_len) + 'd' format_function = lambda x, f = format: _formatInteger(x, f) - elif issubclass(type, _nt.floating): + elif issubclass(dtype, _nt.floating): format = _floatFormat(data, precision, suppress_small) format_function = lambda x, f = format: _formatFloat(x, f) - elif issubclass(type, _nt.complexfloating): + elif issubclass(dtype, _nt.complexfloating): real_format = _floatFormat( data.real, precision, suppress_small, sign=0) imag_format = _floatFormat( @@ -174,7 +172,6 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ', next_line_prefix += " "*len(prefix) # skip over array( - lst = _formatArray(a, format_function, len(a.shape), max_line_width, next_line_prefix, separator, _summaryEdgeItems, summary_insert)[:-1] |