title: Speed up python loop
body: <p>I'm trying to speed up the following python code:</p>
  
  <pre><code>for j in range(4,len(var_s),3):
      mag_list.append(float(var_s[j]))
  mag_list = [value for value in mag_list if value != 99.]
  med_mag = np.median(mag_list)
  </code></pre>
  
  <p>Is there a nice way to combine the two for-loops into one? This way, it is really slow. What I need is to extract every third entry from the var_s list, beginning with the fifths, if the value of that entry is not equal to 99. Of the resulting list, I need the median. 
  Thanks!</p>