diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2006-07-05 20:09:11 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2006-07-05 20:09:11 +0000 |
commit | 823ca7e3c354849238f15f1117f7cc8911933fb8 (patch) | |
tree | 777e64c72259a148248558d5f37556513e5301f2 /numpy/lib/function_base.py | |
parent | 8027438e2ecf9333a23b116d5031a3b0abfab864 (diff) | |
download | numpy-823ca7e3c354849238f15f1117f7cc8911933fb8.tar.gz |
In meshgrid, use views on the input parameters to avoid changing their
shapes. Fixes #169.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index f1d31c856..74352ac9a 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -920,9 +920,9 @@ def meshgrid(x,y): x = asarray(x) y = asarray(y) numRows, numCols = len(y), len(x) # yes, reversed - x.shape = 1, numCols + x = x.reshape(1,numCols) X = x.repeat(numRows, axis=0) - y.shape = numRows,1 + y = y.reshape(numRows,1) Y = y.repeat(numCols, axis=1) return X, Y |