[Numpy-discussion] fancy view question

Stéfan van der Walt stefan@sun.ac...
Tue Feb 17 08:58:57 CST 2009


2009/2/17 Gael Varoquaux <gael.varoquaux@normalesup.org>:
> That's handy, you should commit this somewhere. Actually, it would be
> even cooler if you could have different zoom factor in different
> direction :).

Something like this:

a = np.array([[1, 2, 3],
              [4, 5, 6]])
print a
print zoom(a, x=2, y=3)

[[1 2 3]
 [4 5 6]]
[[1 1 2 2 3 3]
 [1 1 2 2 3 3]
 [1 1 2 2 3 3]
 [4 4 5 5 6 6]
 [4 4 5 5 6 6]
 [4 4 5 5 6 6]]

(Code attached)

Cheers
Stéfan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zoom.py
Type: text/x-python-script
Size: 743 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20090217/fdd4a0eb/attachment.bin 


More information about the Numpy-discussion mailing list