Does anyone have an idea why I can't do this?

 for k in range(nr):
  contribution=N.zeros(shape(H['area']))
  contribution=[contribution+grid[:,:,z:,k,0]/A for z in
range(len(H['outheight']))]
  zplot[:,:,k]=zplot[:,:,k]+contribution;


And on the interactive line:
>>> shape(contribution)
(360, 180)
>>> shape(grid[:,:,0,0,0])
(360, 180)
>>>


But I get the error:
ValueError: shape mismatch: objects cannot be broadcast to a single shape

 for the highlighted line.

Thanks!!
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to