title: Textblob sentiment analysis on a csv file
body: <p>I have a csv file with around 50 rows of sentences. I'm using the textblob sentiment analysis tool. To test the polarity of a sentence, the example shows you write a sentence and the polarity and subjectivity is shown. However, it only works on a single sentence, I want it to work for the csv file that I have, as I can't put in each row and test them individually as it would take too long. How would I go about doing this? </p>
  
  <p>TextBlob show this example, when I type in a sentence, the polarity shows, you can't input two sentences at one time, it doesn't let you. How would i input my csv file into the example below to give me the polarity for all rows?</p>
  
  <pre><code>&gt;&gt;&gt; testimonial = TextBlob("Textblob is amazingly simple to use. What great fun!")
  &gt;&gt;&gt; testimonial.sentiment
  Sentiment(polarity=0.39166666666666666, subjectivity=0.4357142857142857)
  &gt;&gt;&gt; testimonial.sentiment.polarity
  0.39166666666666666
  </code></pre>
  
  <p>edited chishaku solution and it worked for me. Solution:</p>
  
  <pre><code>import csv
  from textblob import TextBlob
  
  infile = 'xxx.csv'
  
  with open(infile, 'r') as csvfile:
      rows = csv.reader(csvfile)
      for row in rows:
          sentence = row[0]
          blob = TextBlob(sentence)
          print blob.sentiment
  </code></pre>