circulate/sslc_allreg.py
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
Minor corrections.


math_scores = []
for record in open('sslc1.txt'):
    fields = record.split(';')

    math_score = fields[5].strip()
    if math_score != 'AA':
        math_scores.append(int(math_score))
    else:
        math_scores.append(0)


# List method
print "Mean: ", mean(math_scores)

print "Median: ", median(math_scores)

print "Standard Deviation: ", std(math_scores)

# Array method

math_scores = array(math_scores)

print "Mean: ", mean(math_scores)

print "Median: ", median(math_scores)

print "Standard Deviation: ", std(math_scores)