[Tutor] parsing an array

sith . sith618 at yahoo.com
Sat Nov 10 02:53:53 CET 2007


newfile = open('y.txt')
  >>> for line in newfile:
  ...  print line.rstrip()
  
3 5 7
  11 8 10
   
  Hi,
I'm trying to parse an array.  Now that I can open and read lines in my array, how can I access individual elements of my multidimensional array?  I'd like to loop through the array and compare values in each line.  
If w is the array, if w[0][1]<w[0][2], write w[0][0] to w[0][3]
Numpy?  Thanks.

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071109/5216dfc8/attachment.htm 


More information about the Tutor mailing list