Fix order kwarg for some versions of numpy.copy

It seems it isn't always a valid kwarg. This bypasses that problem
by calling `np.array` directly (which is just what `np.copy` does
under the hood anyway).
This commit is contained in:
Juan Nunez-Iglesias
2015-01-08 18:25:51 +11:00
parent b1891dc24e
commit d538abdb97
+1 -1
View File
@@ -1532,7 +1532,7 @@ def crop(ar, crop_width, copy=False, order='K'):
crops = _validate_lengths(ar, crop_width)
slices = [slice(a, ar.shape[i] - b) for i, (a, b) in enumerate(crops)]
if copy:
cropped = np.copy(ar[slices], order=order)
cropped = np.array(ar[slices], order=order, copy=True)
else:
cropped = ar[slices]
return cropped