From cdbcee59fbe407dcfa3a81fc18f95eca4e8ec6c4 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 21 Mar 2006 05:21:43 +0000 Subject: Fix reshape to always interpret as C-contiguous unless fortran=True is given or fortran=None and array is already fortran array. --- numpy/core/oldnumeric.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/core/oldnumeric.py') diff --git a/numpy/core/oldnumeric.py b/numpy/core/oldnumeric.py index 4531a1056..7778b7c10 100644 --- a/numpy/core/oldnumeric.py +++ b/numpy/core/oldnumeric.py @@ -177,13 +177,13 @@ def take(a, indices, axis=0): result = _wrapit(a, 'take', indices, axis) return result -def reshape(a, newshape): +def reshape(a, newshape, fortran=False): """Change the shape of a to newshape. Return a new view object. """ try: - result = a.reshape(newshape) + result = a.reshape(newshape, fortran=fortran) except AttributeError: - result = _wrapit(a, 'reshape', newshape) + result = _wrapit(a, 'reshape', newshape, fortran=fortran) return result def choose(a, choices): -- cgit v1.2.1