From 622e6867a9b500d30333d157eaffdf44d3c52fe1 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 9 Feb 2006 08:55:38 +0000 Subject: Fixed bug in unicode change. --- numpy/core/arrayprint.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'numpy/core/arrayprint.py') diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index c22580cf9..4e5db082a 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -164,6 +164,9 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ', data.imag, precision, suppress_small, sign=1) format_function = lambda x, f1 = real_format, f2 = imag_format: \ _formatComplex(x, f1, f2) + elif issubclass(dtype, _nt.unicode_): + format = "%s" + format_function = lambda x, f = format: repr(x) else: format = '%s' format_function = lambda x, f = format: format % str(x) -- cgit v1.2.1