diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-08-19 16:56:56 -0500 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-08-19 19:15:18 -0500 |
commit | 5d63992a53ca71c3e00c52031b1f68921137bc4f (patch) | |
tree | bccf1160e02210ad4d10c14f1ffb975a52e44280 | |
parent | 8187c9efcfcaa5d9ae0fcda42f9512b860001ffa (diff) | |
download | numpy-5d63992a53ca71c3e00c52031b1f68921137bc4f.tar.gz |
BUG: Fix detection of structured arrays in mrecords
This check would fail on the structured type `np.dtype([])`.
No test, since I don't really understand mrecords
-rw-r--r-- | numpy/ma/mrecords.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py index daf2f8770..b16e1670a 100644 --- a/numpy/ma/mrecords.py +++ b/numpy/ma/mrecords.py @@ -211,7 +211,7 @@ class MaskedRecords(MaskedArray, object): _localdict = ndarray.__getattribute__(self, '__dict__') _data = ndarray.view(self, _localdict['_baseclass']) obj = _data.getfield(*res) - if obj.dtype.fields: + if obj.dtype.names is not None: raise NotImplementedError("MaskedRecords is currently limited to" "simple records.") # Get some special attributes |