diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-07-05 11:47:29 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-07-05 12:18:26 -0600 |
commit | 8b3e9ae5262c1da1118370cd6e83db9b2166952e (patch) | |
tree | ad552d92d8f806db622da102707571a38faec7c2 /numpy/core/defchararray.py | |
parent | c2ae6aa0103aecdb5e2a71504583451cada1bfbc (diff) | |
download | numpy-8b3e9ae5262c1da1118370cd6e83db9b2166952e.tar.gz |
STY: PEP8 fixes for numpy/core/*.py
Diffstat (limited to 'numpy/core/defchararray.py')
-rw-r--r-- | numpy/core/defchararray.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/numpy/core/defchararray.py b/numpy/core/defchararray.py index ead11e8d8..e273007c9 100644 --- a/numpy/core/defchararray.py +++ b/numpy/core/defchararray.py @@ -55,8 +55,8 @@ def _use_unicode(*args): result should be unicode. """ for x in args: - if (isinstance(x, _unicode) - or issubclass(numpy.asarray(x).dtype.type, unicode_)): + if (isinstance(x, _unicode) or + issubclass(numpy.asarray(x).dtype.type, unicode_)): return unicode_ return string_ @@ -1068,7 +1068,7 @@ def replace(a, old, new, count=None): """ return _to_string_or_unicode_array( _vec_string( - a, object_, 'replace', [old, new] +_clean_args(count))) + a, object_, 'replace', [old, new] + _clean_args(count))) def rfind(a, sub, start=0, end=None): @@ -2039,7 +2039,6 @@ class chararray(ndarray): """ return count(self, sub, start, end) - def decode(self, encoding=None, errors=None): """ Calls `str.decode` element-wise. @@ -2610,10 +2609,10 @@ def array(obj, itemsize=None, copy=True, unicode=None, order=None): if order is not None: obj = numpy.asarray(obj, order=order) - if (copy - or (itemsize != obj.itemsize) - or (not unicode and isinstance(obj, unicode_)) - or (unicode and isinstance(obj, string_))): + if (copy or + (itemsize != obj.itemsize) or + (not unicode and isinstance(obj, unicode_)) or + (unicode and isinstance(obj, string_))): obj = obj.astype((dtype, long(itemsize))) return obj |