author | Prabhu Ramachandran <prabhu@aero.iitb.ac.in> |
Wed, 16 Jun 2010 01:19:34 -0400 | |
branch | scipy2010 |
changeset 401 | 1f4dcd5ca68c |
parent 359 | cb17c87b090e |
permissions | -rw-r--r-- |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
1 |
science = {} |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
2 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
3 |
for record in open('sslc1.txt'): |
359
cb17c87b090e
Fixed errors found during REC workshop.
Puneeth Chaganti <punchagan@fossee.in>
parents:
358
diff
changeset
|
4 |
# record = record.strip() |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
5 |
fields = record.split(';') |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
6 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
7 |
region_code = fields[0].strip() |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
8 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
9 |
score_str = fields[6].strip() |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
10 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
11 |
score = int(score_str) if score_str != 'AA' else 0 |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
12 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
13 |
if score > 90: |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
14 |
science[region_code] += 1 |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
15 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
16 |
figure(1) |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
17 |
pie(science.values(), labels=science.keys()) |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
18 |
title('Students scoring 90% and above in science by region') |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
19 |
savefig('/tmp/science.png') |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
20 |