title: How to eliminate specific rows from an array?
body: <p>I am working on a tool to analyse weather data. At this point all the data is loaded into a n×10-matrix called <code>master_array</code> containing the data as float64 datatype. I built some filters allowing the user to specify the years and months that should be used for further computing. These filters generate lists, e. g. a list containing integers like  <code>years=[2008, 2009, 2010]</code> for the years from 2008 to 2010 or another list <code>months=[8, 9, 10]</code> for August to October. 
  The last column of <code>master_array</code> holds the years when the data was gathered, the column before the months and so on.</p>
  
  <p>What I now struggle with is to build a function that is checking the last column of <code>master_array</code> for any matches with elements of the list <code>years</code> and delete all the <strong>rows</strong> from <code>master_array</code> which have no match.
  If the list <code>years</code> is empty all available data should be kept in <code>master_array</code> for now.</p>
  
  <p>The next step would do essentially the same but with the column before the last column in <code>master_array</code> and of course by using the list <code>months</code> instead of <code>years</code>.</p>
  
  <p>I can not guarantee the values in the <code>master_array</code> are sorted but the function must filter the matrix never the less.</p>
  
  <p>I am pretty sure I have to use numpys delete() and argwhere() but I am open for any simple and tidy solution that will help with this issue.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Edit:<br>
  To me it's <em>very</em> important to keep the <code>master_array</code> or at least a copy of it and delete the rows which are not needed anymore instead of creating a new array using vstack or something similar.</p>