title: How can I target a column of data from a csv?
body: <p>Goal: Find the average of the 'budget' column (data from an imported csv file).</p>
  
  <p>So far I have gotten my program to open and print the contents of the spreadsheet and have cleaned up the formatting some. </p>
  
  <p>I'm not sure how to attach the file to this post, but the columns read ['title,year,length,budget,rating,votes\r\n'] </p>
  
  <p>How can I begin to manipulate the data? More specifically target the 'budget' column and begin doing the math.</p>
  
  <p>PS: I have been asked to figure this out without using the 'import csv' module. </p>
  
  <p>My work so far:</p>
  
  <pre><code>f = open("movies.csv") 
  lines = f.readlines()
  
  i = 0
  
  while i &lt; len(lines):
      line = lines[i]
      line = line[:-2] # remove trailine \r\n\ from line
      print "%4d   %s" % (i+1, line)
      i = i + 1
  </code></pre>