Created
September 30, 2014 18:03
-
-
Save grafuls/48eae8ea0ca7b604f470 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import csv | |
with open('wafer.csv', 'r') as f: | |
reader = csv.reader(f, delimiter=',') | |
wafer = [row for row in reader] | |
wafer_set = set([i[1] for i in wafer]) | |
result = [] | |
for n in wafer_set: | |
result.append([ 0, \ | |
int(n), \ | |
sum([int(i[2]) for i in wafer if i[1] == n and str(i[2]) != '-']), \ | |
sum([1 for i in wafer if i[1] == n and str(i[2]) != '-'])\ | |
]) | |
print result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment