Created
May 5, 2015 16:04
-
-
Save graingerkid/e001d30ceffa3d7da8b4 to your computer and use it in GitHub Desktop.
Basic example of working with a CSV file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
Basic example of working with a CSV file. | |
''' | |
import csv | |
import collections | |
lis = [] | |
with open("file.csv") as f: | |
data = csv.reader(f) | |
for line in data: | |
lis.append(line[3]) | |
counter = collections.Counter(lis) | |
for word, value in counter.iteritems(): | |
print word, value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment