On Wed, Mar 27, 2013 at 11:50 AM, Sayan Chatterjee < sayanchatter...@gmail.com> wrote:
> Dear all, > > When trying to print or assign array elements, getting the following error: > > Traceback (most recent call last): > File "ZA.py", line 32, in <module> > p_za[i] = p_initial[i] + t*K*cos(K*p_initial[i]); > You declare p_za = [] above. So there is no p_za[i]. You should use append since you are adding elements to the end of the list. > IndexError: index out of bounds > > I am using Numpy, is it due to that? I am attaching the code herewith. > > > > -- > > > -------------------------------------------------------------------------- > *Sayan Chatterjee* > Dept. of Physics and Meteorology > IIT Kharagpur > Lal Bahadur Shastry Hall of Residence > Room AB 205 > Mob: +91 9874513565 > blog: www.blissprofound.blogspot.com > > Volunteer , Padakshep > www.padakshep.org > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Joel Goldstick http://joelgoldstick.com
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor