From a32325d1d5fc5e23622db5027a6dd35d42193e95 Mon Sep 17 00:00:00 2001 From: jayvius Date: Thu, 12 Jul 2012 13:39:19 -0500 Subject: Call view object's copy method --- numpy/core/_internal.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy') 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 -- cgit v1.2.1