import scipy.misc as sm
import sys
import matplotlib.pyplot as plt
import numpy.testing as test
lena =sm.lena()
lena_x=512
lena_y=512
yfactor=0.5 # yfactor=float(sys.srgv[1])
xfactor=5/14 # xfactor=float(sys.srgv[2])
resized=lena.repeat(yfactor,axis=0).repeat(xfactor,axis=1)
test.assert_equal((yfactor*lena_x,xfactor*lena_y),resized.shape)
plt.subplot(1,2,1)
plt.imshow(lena)
plt.subplot(1,2,2)
plt.imshow(resized)
plt.show()
#ERRor zero-size array to minimum.reduce without identity
import sys
import matplotlib.pyplot as plt
import numpy.testing as test
lena =sm.lena()
lena_x=512
lena_y=512
yfactor=0.5 # yfactor=float(sys.srgv[1])
xfactor=5/14 # xfactor=float(sys.srgv[2])
resized=lena.repeat(yfactor,axis=0).repeat(xfactor,axis=1)
test.assert_equal((yfactor*lena_x,xfactor*lena_y),resized.shape)
plt.subplot(1,2,1)
plt.imshow(lena)
plt.subplot(1,2,2)
plt.imshow(resized)
plt.show()
#ERRor zero-size array to minimum.reduce without identity