title: Transform columns and rows of a dataframe
body: <p>I have a dataframe:</p>
  <pre><code>ID   Value    Name    Score  Card_type  Card_number
  1      NA     John     242      X           23
  1     124     John      NA      X           23
  1     124     John     242      Y           25
  1     124     NA       242      Y           NA
  2      55     Mike      NA      X           11
  2      55     NA       431      X           11
  2      55     Mike     431      Y           14
  2      NA     Mike     431      Y           14
  </code></pre>
  <p>As you see, there are <code>ID</code>s and each of them has two groups (<code>Card_type</code>) for column <code>Card_number</code>. Also as you see, some rows with same <code>ID</code> and <code>Card_type</code> have same missing values in some columns. What I want to get is, to make each <code>ID</code> be one row with filled columns. And column <code>Card_number</code> must be split into two columns <code>Card_number_type_X</code> and <code>Card_number_type_X</code> and column <code>Card_type</code> must be removed.</p>
  <p>So the desired result must look like this:</p>
  <pre><code>ID   Value    Name    Score   Card_number_type_X  Card_number_type_Y
  1     124     John     242             23                   25
  2      55     Mike     431             11                   14                 
  </code></pre>
  <p>How could I do that?</p>