summaryrefslogtreecommitdiff
path: root/numpy/core/_internal.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r--numpy/core/_internal.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 88a41fd0d..92ab0c8b0 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -286,7 +286,6 @@ def _newnames(datatype, order):
# construct a new array with just those fields copied over
def _index_fields(ary, fields):
from multiarray import empty, dtype
- from numpy import copy
dt = ary.dtype
names = [name for name in fields if name in dt.names]
@@ -296,7 +295,7 @@ def _index_fields(ary, fields):
view_dtype = {'names':names, 'formats':formats, 'offsets':offsets, 'itemsize':dt.itemsize}
view = ary.view(dtype=view_dtype)
- return copy(view)
+ return view.copy()
# Given a string containing a PEP 3118 format specifier,
# construct a Numpy dtype