Instead of passing a single number to the zoom
parameter, give a sequence:
scipy.ndimage.zoom(x, zoom=(1.5, 2.), order=1)
#array([[0, 0, 1, 1, 2, 2],
# [2, 2, 3, 3, 4, 4],
# [4, 4, 5, 5, 6, 6],
# [6, 6, 7, 7, 8, 8]])
With the sequences (2., 2.75)
and (2., 3.5)
you will get output arrays with shapes (6, 8)
and (6, 10)
, respectively.