circulate/sslc_allreg.py
author Christopher Burns <chris.d.burns@gmail.com>
Tue, 29 Jun 2010 01:17:52 -0500
branchscipy2010
changeset 433 af45c8da1d5d
parent 385 c70118cdde66
permissions -rwxr-xr-x
DOC: Add comments about python style.


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)