title: How to conditionally convert rows to columns?
body: <p>I have the following pandas DataFrame:</p>
  <p>df:</p>
  <pre><code>date        col1   col2
  2020/10/29  A      1
  2020/10/30  A      2
  2020/10/28  B      10 
  2020/10/29  B      11
  2020/10/30  B      8
  </code></pre>
  <p>I need to transform it into the following DataFrame:</p>
  <pre><code>date        A   B
  2020/10/28  Nan 10
  2020/10/29  1   11
  2020/10/30  2   8
  </code></pre>
  <p>How can I do it?</p>