> > As ux 's shape is (1,lx,ly), ux(:,1,col) is equal to ux(1,1,col) which
> > is a vector with the elements [ux(1,1,2), ... ux(1,1,ly-1)].
> > Using ":" juste after the reshape seems a lit bit silly...
> 
> Except that python uses 0-based indexing and does not include the last
> number in a slice, while Matlab uses 1-based indexing and includes the
> last number, so really:
>     ux(:,1,col)
> becomes:
>     ux(0, 0, col) # or ux(:, 0, col)
> 
> And if col is
>     col = [2:(ly-1)]
> This needs to be:
>     col = np.arange([1, ly - 1)

You are right about the 0 or 1 based indexing argument, but I was
speaking matlab language as visible in the symbols used for indexing
( () and not [] )... :)

-- 
Fabrice Silva
LMA UPR CNRS 7051

_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to