A Thursday 10 September 2009 11:43:44 Ruben Salvador escrigué: > OK. Thanks everybody :D > But...what is happening now? When executing this code: > > print ' ..... object parameters mutation .....' > print 'np.shape(offspr)', np.shape(offspr) > print 'np.shape(offspr[0])', np.shape(offspr[0]) > print "np.shape(r)", np.shape(r) > print "np.shape(offspr_sigma)", np.shape(offspr_sigma) > a = offspr_sigma * np.random.normal(0, 1, shp_sigma) > print "np.shape(a)", np.shape(a) > t4 = clock() > offspr[...] = r > offspr += a[:,None] > t5 = clock() - t4 > print "Pythonic time (no array creation) ==> %.8f seconds" % t5 > t2 = clock() > offspr = r + a[:,None] > t3 = clock() - t2 > print "Pythonic time ==> %.8f seconds" % t3 > t = clock() > for i in range(lambd): > offspr[i] = r[i] + a[i] > t1 = clock() - t > print "For loop time ==> %.8f seconds" % t1 > > what I get is [clip]
What's your definition for offspr? Please always try to send auto-contained code snippets so that other people can better help you. -- Francesc Alted
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
