x_pos = [] y_pos = [] ########################### import csv with open('C:/Users/Brian/Google Drive/Sophomore/Physics/Advanced Projects Lab 491/2.56 micrometer tracking 5-14-14/2.56 micrometer parsed.csv') as f: reader = csv.reader(f) for row in reader: x_pos.append(float(row[0])) y_pos.append(float(row[1])) ########################### # convert lists to arrays for simplified calculations x_pos = array(x_pos) y_pos = array(y_pos) x_pos = x_pos*10**(-6) y_pos = y_pos*10**(-6) x_mean = mean(x_pos) y_mean = mean(y_pos) x_var = mean((x_mean - x_pos)**2) y_var = mean((y_mean - y_pos)**2) print("The x variation is " + str(x_var)) print("The y variation is " + str(y_var)) kb = 1.3806488e-23 T = 298 x_strength = (kb*T)/x_var y_strength = (kb*T)/y_var x_strength = x_strength*(10**12)/(10**6) y_strength = y_strength*(10**12)/(10**6) x_strength # piconewtons/micrometer y_strength # piconewtons/micrometer