Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. from scipy import stats
  2. from scipy.optimize import least_squares
  3. import matplotlib.pyplot as plt
  4. import numpy as np
  5. %matplotlib inline
  6.  
  7. Counts = np.loadtxt('Counts.csv', delimiter = ',', unpack = True)
  8. # loads csv file as an array assigns columns to variables
  9.  
  10. # Number of counts = 10
  11.  
  12. AvgCounts = np.sum(Counts)/np.size(Counts)
  13. AvgCountsError = np.sqrt(AvgCounts)
  14. RateError = np.sqrt((AvgCountsError/AvgCounts)**2 + (timeError/time)**2)
  15.  
  16. time = 60
  17.  
  18. Rate = AvgCounts/time
  19. print(Rate, "+-", RateError)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement