title: compare two different DataFrames
body: <p>i'm newbie in Pandas, please help.
  I got two DataFrames to compare
  DF1:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Code</th>
  <th>Product</th>
  <th>Day</th>
  <th>C_Code</th>
  <th>Name</th>
  <th>Qty</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>001</td>
  <td>Prod_X</td>
  <td>01.01.2022</td>
  <td>C_0001</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  <tr>
  <td>002</td>
  <td>Prod_Y</td>
  <td>01.01.2022</td>
  <td>C_0001</td>
  <td>Mr_X</td>
  <td>24</td>
  </tr>
  <tr>
  <td>001</td>
  <td>Prod_X</td>
  <td>15.01.2022</td>
  <td>C_0002</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  <tr>
  <td>002</td>
  <td>Prod_Y</td>
  <td>16.01.2022</td>
  <td>C_0003</td>
  <td>Mr_X</td>
  <td>24</td>
  </tr>
  <tr>
  <td>001</td>
  <td>Prod_X</td>
  <td>17.01.2022</td>
  <td>C_0004</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>DF2:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Day</th>
  <th>C_Code</th>
  <th>Name</th>
  <th>Qty</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>01.01.2022</td>
  <td>C_0001</td>
  <td>Mr_X</td>
  <td>36</td>
  </tr>
  <tr>
  <td>15.01.2022</td>
  <td>C_0002</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  <tr>
  <td>16.01.2022</td>
  <td>C_0003</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Column <strong>Day</strong> &amp; Column <strong>C_Code</strong> unique.Conditions if DF1[<strong>Day</strong>]&amp;[<strong>C_Code</strong>] == DF2 [<strong>Day</strong>]&amp;[<strong>C_Code</strong>] then  compare <strong>QTY</strong>, if DF1.sum[<strong>QTY</strong>]&lt;= DF2[<strong>QTY</strong>] write row into DF3, if  DF1[<strong>QTY</strong>] &gt; DF2[<strong>QTY</strong>] then row from DF1 write into DF3 and put value from DF2[<strong>QTY</strong>], difference between DF1[<strong>QTY</strong>] and DF2[<strong>QTY</strong>] write into DF4. in the output should be</p>
  <p>Correct List:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Code</th>
  <th>Product</th>
  <th>Day</th>
  <th>C_Code</th>
  <th>Name</th>
  <th>Qty</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>001</td>
  <td>Prod_X</td>
  <td>01.01.2022</td>
  <td>C_0001</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  <tr>
  <td>002</td>
  <td>Prod_Y</td>
  <td>01.01.2022</td>
  <td>C_0001</td>
  <td>Mr_X</td>
  <td>24</td>
  </tr>
  <tr>
  <td>001</td>
  <td>Prod_X</td>
  <td>15.01.2022</td>
  <td>C_0002</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  <tr>
  <td>002</td>
  <td>Prod_Y</td>
  <td>16.01.2022</td>
  <td>C_0003</td>
  <td>Mr_X</td>
  <td><strong>12</strong></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Incorrect List:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Code</th>
  <th>Product</th>
  <th>Day</th>
  <th>C_Code</th>
  <th>Name</th>
  <th>Qty</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>002</td>
  <td>Prod_Y</td>
  <td>16.01.2022</td>
  <td>C_0003</td>
  <td>Mr_X</td>
  <td><strong>12</strong></td>
  </tr>
  <tr>
  <td>001</td>
  <td>Prod_X</td>
  <td>17.01.2022</td>
  <td>C_0004</td>
  <td>Mr_X</td>
  <td>12</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>How i understand i need to use groupBy, but i don't understand how
  a lot of tnx for help!</p>