title: Applying Pandas style between two dataframes differences
body: <p>I've seen a lot of questions about finding the differences between two pandas dataframes, however here i'm trying to apply a <a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/style.html" rel="nofollow noreferrer">Pandas.Style</a> difference between two dataframes.  Given these two example dataframes i'm hoping to have a formatter applied to right[1, "B"] and right["D"] because they're different that lefts values or new in general:</p>
  
  <pre><code>left = pd.DataFrame([[1,1,1], [2,2,2]], columns=list("ABC"))
  right = pd.DataFrame([[1,1,10], [2,5,10]], columns=list("ABD"))
  </code></pre>
  
  <p>Here's my idea for the formatting method guided by the pandas documentation</p>
  
  <pre><code>def formatter(s, new):
      if s.name not in new.columns:
          # column doesn't exist strike through entire thing
          return "color: red; text-decoration: line-through;"
  
      elif not s.equals(new[s.name]):
          # apply per value a comparision of the elements
          # for val in s: 
              # if val != right[val.index??]:
                  return "color: red; text-decoration: line-through;"
  
      return "color: black;"
  
  left.style.apply(formatter, args=(right))
  </code></pre>
  
  <p>My thinking is that afterwards I should have something that is html like such:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table border="1" class="dataframe"&gt;
    &lt;thead&gt;
      &lt;tr style="text-align: right;"&gt;
        &lt;th&gt;&lt;/th&gt;
        &lt;th&gt;A&lt;/th&gt;
        &lt;th&gt;B&lt;/th&gt;
        &lt;th&gt;C&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;th&gt;0&lt;/th&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;1&lt;/th&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table border="1" class="dataframe"&gt;
    &lt;thead&gt;
      &lt;tr style="text-align: right;"&gt;
        &lt;th&gt;&lt;/th&gt;
        &lt;th&gt;A&lt;/th&gt;
        &lt;th&gt;B&lt;/th&gt;
        &lt;th&gt;C&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;th&gt;0&lt;/th&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td style="color: red; text-decoration: line-through;"&gt;10&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th&gt;1&lt;/th&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td style="color: red; text-decoration: line-through;"&gt;5&lt;/td&gt;
        &lt;td style="color: red; text-decoration: line-through;"&gt;10&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>