changeset 358 | 162e3e453920 |
child 359 | cb17c87b090e |
355:6af6441034f9 | 358:162e3e453920 |
---|---|
1 science = {} |
|
2 |
|
3 for record in open('sslc1.txt'): |
|
4 record = record.strip() |
|
5 fields = record.split(';') |
|
6 |
|
7 region_code = fields[0].strip() |
|
8 |
|
9 score_str = fields[6].strip() |
|
10 |
|
11 score = int(score_str) if score_str != 'AA' else 0 |
|
12 |
|
13 if score > 90: |
|
14 science[region_code] += 1 |
|
15 |
|
16 figure(1) |
|
17 pie(science.values(), labels=science.keys()) |
|
18 title('Students scoring 90% and above in science by region') |
|
19 savefig('/tmp/science.png') |
|
20 |