circulate/sslc_bug.py
branchscipyin2010
changeset 454 a919e9903308
parent 452 f9417abb23a6
child 455 84b7a3f4a15a
equal deleted inserted replaced
452:f9417abb23a6 454:a919e9903308
     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