diff options
author | Chris Billington <chrisjbillington@gmail.com> | 2018-08-16 16:27:28 -0400 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-08-16 15:27:28 -0500 |
commit | fcbc3ba0130dd1e9b7046f934bf0ffd6ee2c362d (patch) | |
tree | 8a9cb039d18ad710b0876af32297fdc8d8a92006 /numpy/core/_internal.py | |
parent | 591880b0a7bcbb493d9ec023783157818f2f5236 (diff) | |
download | numpy-fcbc3ba0130dd1e9b7046f934bf0ffd6ee2c362d.tar.gz |
BUG: Fixes for unicode field names in Python 2 (#11642)
* Fixes for unicode field names in Python 2
* Allow specifying a single comma-separated unicode string of names in np.rec.fromarrays
* Allow sorting on unicode field names.
This addresses some of the problems raised in issue #2407
* Use skipif decorator, check constructed array has correct data
* cleaner isinstance() check, have new tests to run on py3 as well
* Fix silly mistake in test
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r-- | numpy/core/_internal.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py index 1cf89aab0..ce7ef7060 100644 --- a/numpy/core/_internal.py +++ b/numpy/core/_internal.py @@ -9,7 +9,7 @@ from __future__ import division, absolute_import, print_function import re import sys -from numpy.compat import basestring +from numpy.compat import basestring, unicode from .multiarray import dtype, array, ndarray try: import ctypes @@ -294,7 +294,7 @@ def _newnames(datatype, order): """ oldnames = datatype.names nameslist = list(oldnames) - if isinstance(order, str): + if isinstance(order, (str, unicode)): order = [order] seen = set() if isinstance(order, (list, tuple)): |