Yes we can vectorize. regards, Sarma.
On Fri, Oct 13, 2017 at 9:43 PM, Peter Otten <__pete...@web.de> wrote: > D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > > f = np.zeros(40) > > v = np.arange(0,4,0.1) > > for i in np.arange(0, 40): > > f[i] = v[i]**2*(np.exp(-v[i]**2)) > > Note that you can write this without Python loop as > > v = np.arange(0, 4, 0.1) > f = v**2 * np.exp(-v**2) > > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor