summaryrefslogtreecommitdiff
path: root/numpy/lib/recfunctions.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-01-23 16:50:25 -0800
committerGitHub <noreply@github.com>2020-01-23 16:50:25 -0800
commit68224f43d09393c1981bb83ee3c13a5158d2817c (patch)
tree94153dd189f924c399c2621c325fd2fd2a5e6ba6 /numpy/lib/recfunctions.py
parent4c32890b3628434996824ae2056333b9a389f46c (diff)
parentb4e3a4227e3a9cfe28717db458e67d79e916a418 (diff)
downloadnumpy-68224f43d09393c1981bb83ee3c13a5158d2817c.tar.gz
Merge pull request #15407 from charris/replace-basestring
MAINT: Replace basestring with str.
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r--numpy/lib/recfunctions.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
index af4cfa09d..03c0c82f5 100644
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -13,7 +13,6 @@ from numpy.ma import MaskedArray
from numpy.ma.mrecords import MaskedRecords
from numpy.core.overrides import array_function_dispatch
from numpy.lib._iotools import _is_string_like
-from numpy.compat import basestring
from numpy.testing import suppress_warnings
_check_fill_value = np.ma.core._check_fill_value
@@ -299,7 +298,7 @@ def _izip_fields(iterable):
"""
for element in iterable:
if (hasattr(element, '__iter__') and
- not isinstance(element, basestring)):
+ not isinstance(element, str)):
for f in _izip_fields(element):
yield f
elif isinstance(element, np.void) and len(tuple(element)) == 1:
@@ -698,7 +697,7 @@ def append_fields(base, names, data, dtypes=None,
if len(names) != len(data):
msg = "The number of arrays does not match the number of names"
raise ValueError(msg)
- elif isinstance(names, basestring):
+ elif isinstance(names, str):
names = [names, ]
data = [data, ]
#
@@ -1455,7 +1454,7 @@ def join_by(key, r1, r2, jointype='inner', r1postfix='1', r2postfix='2',
"'outer' or 'leftouter' (got '%s' instead)" % jointype
)
# If we have a single key, put it in a tuple
- if isinstance(key, basestring):
+ if isinstance(key, str):
key = (key,)
# Check the keys