[Numpy-discussion] inconsistent mgrid results

Andrew Corrigan acorriga at gmu.edu
Tue Feb 27 13:26:30 EST 2007


I'm confused about the following:

 >>> print mgrid[2.45:2.6:0.05, 0:5:1]
[[[ 2.45  2.45  2.45  2.45  2.45]
 [ 2.5   2.5   2.5   2.5   2.5 ]]

[[ 0.    1.    2.    3.    4.  ]
 [ 0.    1.    2.    3.    4.  ]]]
 >>> print mgrid[2.45:2.6:0.05]
[ 2.45  2.5   2.55]

In the first case in the first dimension I get 2.45, 2.5.   In the 
second case in the first dimension I get 2.45, 2.5, 2.55   In both cases 
I'm using 2.45:2.6:0.05  to specify the grid in the first dimension.  
Why is there a difference?  Am I using mgrid incorrectly?   I'm using 
the latest numpy release from sourceforge.
Thanks, Andrew





More information about the NumPy-Discussion mailing list