From ea8e24ac702226c4d189fcef264b7ed2388268c4 Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Thu, 21 Jan 2010 15:26:11 +0530 Subject: Added files to be circulated during workshops. --- circulate/sslc_science.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 circulate/sslc_science.py (limited to 'circulate/sslc_science.py') diff --git a/circulate/sslc_science.py b/circulate/sslc_science.py new file mode 100644 index 0000000..7f96128 --- /dev/null +++ b/circulate/sslc_science.py @@ -0,0 +1,22 @@ +science = {} + +for record in open('sslc1.txt'): + record = record.strip() + fields = record.split(';') + + region_code = fields[0].strip() + + if region_code not in science: + science[region_code] = 0 + + score_str = fields[6].strip() + + score = int(score_str) if score_str != 'AA' else 0 + + if score > 90: + science[region_code] += 1 + +figure(1) +pie(science.values(), labels=science.keys()) +title('Students scoring 90% and above in science by region') +savefig('science.png') -- cgit From 9df774c69643bf42c22a4c57435ff0fc7ccdaeb0 Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Thu, 21 Jan 2010 17:14:52 +0530 Subject: Fixed errors found during REC workshop. --- circulate/sslc_science.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'circulate/sslc_science.py') diff --git a/circulate/sslc_science.py b/circulate/sslc_science.py index 7f96128..83a52ae 100644 --- a/circulate/sslc_science.py +++ b/circulate/sslc_science.py @@ -1,7 +1,7 @@ science = {} for record in open('sslc1.txt'): - record = record.strip() +# record = record.strip() fields = record.split(';') region_code = fields[0].strip() -- cgit