diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-11-06 11:21:22 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-11-06 11:21:22 -0700 |
commit | 9cc7bc3ad4e3e95f76ec1036adf45990d204a756 (patch) | |
tree | 4779b52a2af092c9d2d73e1d563befed608d0789 /numpy/core/records.py | |
parent | cdef8d3e408899f7e0cc1037d358ece8d9cc3324 (diff) | |
parent | c06726daa4d57893bc6132c3f311bd14ec6dc110 (diff) | |
download | numpy-9cc7bc3ad4e3e95f76ec1036adf45990d204a756.tar.gz |
Merge pull request #6643 from ahaldane/recarray_getitem_returns_recarray
ENH: make recarray.getitem return a recarray
Diffstat (limited to 'numpy/core/records.py')
-rw-r--r-- | numpy/core/records.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py index 4ce3fe98a..b07755384 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -502,6 +502,7 @@ class recarray(ndarray): # we might also be returning a single element if isinstance(obj, ndarray): if obj.dtype.fields: + obj = obj.view(recarray) if issubclass(obj.dtype.type, nt.void): return obj.view(dtype=(self.dtype.type, obj.dtype)) return obj |