title: ChiSquare calculation returning all zeros
body: <p>EDIT: after more trial and error, I figured out that for some reason, python says that 1/52 is 0, can anyone explain me why, so I can avoid this problem in the future?</p>
  
  <p>I've been struggling with a script for a while now, mainly because me or my fellow students simply can't find out what's wrong with it.</p>
  
  <p>Trying to keep things simple, we've got data and a model and we have to rescale some of the datapoints to the model and then do a chi2square minimalization in order to find the best rescaling factor. </p>
  
  <p>I've tried multiple things already. Tried putting everything in 1 loop, when that didn't work, I tried splitting the loops up etc.</p>
  
  <p>The relevant part of my code looks like this:</p>
  
  <pre><code>#Here I pick the values of the model that correspond to the data
  y4 = np.zeros((len(l),1))
  for x in range(0,len(l)):
    if l[x] &lt; 2.16:
      for y in range(0,len(lmodel)):
        if lmodel[y] == l[x]:
      y4[x] = y2[y]
        elif lmodel[y] &lt; l[x] &lt; lmodel[y+1]:
      y4[x] = (y2[y] + y2[y+1])/2
    else:
      y4[x] = y1[x]
  
  
  #Do Chi2 calculation
  #First, I make a matrix with all the possible rescaled values
  chi2 = np.zeros((200,1))
  y3 = np.zeros((len(l),len(chi2)))
  for z in range(0,len(chi2)):
    for x in range(0,len(l)):
      if l[x] &lt; 2.16:
        y3[x,z] = y1[x]*10**(0.4*Al[x]*z/100)
      else:
        y3[x,z] = y1[x]
  
  #Here I calculate the chisquare for each individual column and put it in the chi2 array
  dummy = np.zeros((len(l),1))
  for x in range(0,len(chi2)):
    for t in range(0, len(l)):
      dummy[t] = (1/52)*((y3[t,x] - y4[t])/fle[t])**2
    chi2[x] = np.sum(dummy)
  </code></pre>
  
  <p>The thing is that no matter what I try, for some reason, my dummy array is always all zeros, making every single chi square value 0.</p>
  
  <p>I've tried making 'dummy' a matrix and summing afterwards, I've tried printing individual values for the calculation of the dummy[t]'s, and some of them were 0 (as expected), some weren't, so logically, if the individual values aren't all 0, neither should every value in dummy be.</p>
  
  <p>I just can't find where I go wrong, and why I keep getting arrays of zeros.</p>