[Numpy-discussion] inconsistent mgrid results

Andrew Corrigan acorriga@gmu....
Tue Feb 27 12:26:30 CST 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