title: Plot x-y data if x entry meets condition python
body: <p>I would like to perform plots/fits for x-y data, provided that the data set's x values meet a condition (i.e. are greater than 10).</p>
  
  <p>My attempt:</p>
  
  <pre><code>x_values, y_values = loadtxt(fname, unpack=True, usecols=[1, 0])
  
  for x in x_values:
      if x &gt; 10:
          (m,b)=polyfit(x_values,y_values,1)
          yp = polyval([m,b],x_values)
          plot(x_values,yp)
          scatter(x_values,y_values)
      else:
          pass
  </code></pre>
  
  <p>Perhaps it would be better to remove x-y entries for rows where the x value condition is not met, and then plot/fit?</p>