author | Santosh G. Vattam <vattam.santosh@gmail.com> |
Fri, 23 Apr 2010 08:49:25 +0530 | |
changeset 385 | c70118cdde66 |
parent 359 | cb17c87b090e |
permissions | -rwxr-xr-x |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
1 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
2 |
math_scores = [] |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
3 |
for record in open('sslc1.txt'): |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
4 |
fields = record.split(';') |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
5 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
6 |
math_score = fields[5].strip() |
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
7 |
if math_score != 'AA': |
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
8 |
math_scores.append(int(math_score)) |
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
9 |
else: |
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
10 |
math_scores.append(0) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
11 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
12 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
13 |
# List method |
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
14 |
print "Mean: ", mean(math_scores) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
15 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
16 |
print "Median: ", median(math_scores) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
17 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
18 |
print "Standard Deviation: ", std(math_scores) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
19 |
|
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
20 |
# Array method |
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
21 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
22 |
math_scores = array(math_scores) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
23 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
24 |
print "Mean: ", mean(math_scores) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
25 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
26 |
print "Median: ", median(math_scores) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
27 |
|
385
c70118cdde66
Minor corrections.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
359
diff
changeset
|
28 |
print "Standard Deviation: ", std(math_scores) |
358
162e3e453920
Added files to be circulated during workshops.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
29 |