> 
> # Make a 4D view of this data, such that b[i,j]
> # is a 2D block with shape (4,4) (e.g. b[0,0] is
> # the same as a[:4, :4]).
> b = as_strided(a, shape=(a.shape[0]/4, a.shape[1]/4, 4, 4),
>                strides=(4*a.strides[0], 4*a.strides[1], a.strides[0], 
> a.strides[1]))
> 

Yes :-) Being used to Fortran (and also MATLAB) this is the kind of mapping It 
never occurs for me to think about. What else but NumPy is flexible enough to 
do this? :-)

Sturla
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to