title: Create or populate a table in python based on other tables
body: <p>I am new to python/pandas and have a fairly basic question.</p>
  
  <p>I have 2 tables with numerous columns and "ID" as the primary key.</p>
  
  <p>I want to create another table with conditions based on the 2 tables.</p>
  
  <p>For example: Table A, Table B --> Table C</p>
  
  <p>In SQL I would write something like this:</p>
  
  <pre><code>create table TableC as select 
  a.ID, 
  case when b.Field1=1000 and a.Field1=50 then 20 else 0 end as FieldA,
  case when b.Field2=15 and a.Field2=100 then 100 else 0 end as FieldB
  from TableA a, TableB b
  where a.ID=b.ID
  order by 1
  </code></pre>
  
  <p>I am struggling to put similar together Table C using python.
  I have tried to make a function but I cant seem to include more than 1 table in the function nor create a new table based off multiple tables.</p>
  
  <p>Any help will be much appreciated.</p>