title: How to convert dataframe from horizontal to vertical
body: <p>I have the following structure of  dataframe:</p>
  <pre><code>| Number   | From | To |D1_value |D2_value|D3_value |
  | 111      | A    | B  |    10   |   12   | NaN     |
  | 222      | B    | A  |   NaN   |   4    | 6       |
  </code></pre>
  <p>How to convert it into:</p>
  <pre><code>|Number  | From | To | Type | Value |
  |111     | A    | B  | D1   | 10    |
  |111     | A    | B  | D2   | 12    |
  |222     | B    | A  | D2   | 4     |
  |222     | B    | A  | D3   | 6     |
  </code></pre>
  <p>I will be beyond grateful if you can help me!</p>