circulate/sslc_allreg.py
author Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
Mon, 14 Jun 2010 20:16:05 -0400
branchscipy2010
changeset 399 7775af81b51a
parent 385 c70118cdde66
permissions -rwxr-xr-x
Initial checkin of file with details of the plan for the tutorial.


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)