title: Subtract dataframe rows by a column value
body: <p>I have an analysis result table</p>
  <pre><code>         Name  Analysis  Result                 Date    Type
  0      Doe J.  Albumine    10.6   23.02.2021 8:07:22  before
  1      Doe J.  Albumine     6.5   25.03.2021 8:08:09   after
  2     Pine C.  Albumine    13.3   25.03.2021 9:17:54  before
  3     Pine C.  Albumine    11.0   22.02.2021 9:25:54   after
  4  Jackson D.  Albumine    14.2  23.02.2021 10:51:38  before
  5   Jackson D  Albumine    12.2           23.03.2021   after
  6  Schafer L.  Albumine     8.4  25.02.2021 10:39:39  before
  7  Schafer L.  Albumine     9.3  25.03.2021 12:06:15   after
  </code></pre>
  <p>My goal is to calculate the difference between two analyses of each patient (these are all fictional) based on 'Type' column and obtain a following table:</p>
  <pre><code>     Name  Before  After  Difference
  0  Doe j.    10.6    6.5         3.9
  </code></pre>
  <p>I've tried groupby but didn't succeed. Would appreciate any help.</p>