summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r--numpy/core/arrayprint.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
index a3edb64d4..6d3c52990 100644
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -188,10 +188,13 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ',
# make sure True and False line up.
format_function = _boolFormatter
elif issubclass(dtypeobj, _nt.integer):
- max_str_len = max(len(str(maximum.reduce(data))),
- len(str(minimum.reduce(data))))
- format = '%' + str(max_str_len) + 'd'
- format_function = lambda x: _formatInteger(x, format)
+ if issubclass(dtypeobj, _nt.timeinteger):
+ format_function = str
+ else:
+ max_str_len = max(len(str(maximum.reduce(data))),
+ len(str(minimum.reduce(data))))
+ format = '%' + str(max_str_len) + 'd'
+ format_function = lambda x: _formatInteger(x, format)
elif issubclass(dtypeobj, _nt.floating):
if issubclass(dtypeobj, _nt.longfloat):
format_function = _longfloatFormatter(precision)