title: Select data based on multiple criteria using Pandas
body: <p>I am new to using Pandas. I want to select rows from a dataframe where multiple columns match in value. Along the lines of:</p>
  
  <p>if column A equals column AB and column B equals column BC </p>
  
  <p>then I want those values. </p>
  
  <p>I haven't actually used an if statement, I read iteration was not good to use with pandas.</p>
  
  <p>I've tried to find a solution, I'm not sure if it is my syntax or if its unhappy with different data types of the columns?</p>
  
  <p>My code is a little long, so I'll provided just the line where I attempt the selection but I can post the entire code if that is helpful.</p>
  
  <pre><code>dfequal=dfMerged.loc[(dfMerged['MetCode']==dfMerged['GCD_METCODE']) &amp; (dfMerged[dfMerged['Zone Code']==dfMerged['GCD_Senior_ZONE']]) &amp; (dfMerged[dfMerged['Municipality Code']==dfMerged['GCD_CSDUID']])]
  </code></pre>
  
  <p>Edit*</p>
  
  <p>The expected output would be a dataframe where only rows where the statement is true would exist.</p>
  
  <p>This is the error:<br>
  ValueError: operands could not be broadcast together with shapes (84778,) (4462,)               </p>
  
  <p>This is my data table i'm pulling from</p>
  
  <p><a href="https://i.stack.imgur.com/h4Gdu.png" rel="nofollow noreferrer">Sample Data</a></p>
  
  <pre><code>    FileID,MetCode,Municipality Code,Zone 
  Code,GCD_Senior_ZONE,GCD_METCODE,GCD_CSDUID
  A100101,7175,1005018,303006,303006,7175,1005018
  A100102,7175,1005018,303006,303006,7175,1005018
  A100103,7175,1005018,303006,303006,7175,1005018
  A100104,7280,1006009,202003,202003,7280,1006009
  A100105,7300,1006017,202003,202003,7300,1006017
  A100108,7300,1006017,202003,202003,7300,1006017
  A100109,7300,1006017,202003,202003,7300,1006017
  A100110,1640,1001485,101001,101001,1640,1001485
  A100111,1640,1001517,101001,101001,1640,1001517
  A100114,9000,1008011,202003,202003,0,1008011
  A100115,9000,1001370,101002,101002,0,1001370
  A100119,9000,1003034,202003,202003,0,1003034
  </code></pre>