On Wednesday 11 April 2007 03:28:09 elekis wrote:

Hi,
Just some quick comments:


1. learn list comprehensions, they're far faster than regular loops.

data = [(i,j,int(numpy.random.random()*10))
               for i in range(XI) for j in range(JI)]

2. if you don't really need the triplets, but just the random part, just use:
Z = (numpy.random.random(XI*YI)*10).astype(int).reshape(Xl,Yl)

3. It's more efficient to use numpy.empty than numpy.zeros to initialize an 
array you're going to fill afterwards.

4. You may have found a bug in plot_wireframe, actually. The code doesn't look 
quite right. My understanding is that the 3d part is not really supported, 
either...


Hope it helps.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to