circulate/sslc_allreg.py
author Puneeth Chaganti <punchagan@fossee.in>
Thu, 09 Dec 2010 23:11:12 +0530
branchscipyin2010
changeset 448 dc8d666a594a
parent 385 c70118cdde66
permissions -rwxr-xr-x
Changed date format in day1/session{3,4,5}.tex.


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)