title: How can I convert Dataframe Column1:Column2 (key:value) in Dictionary in Pyspark?
body: <p>I have a Dataframe with distinct values of Atr1 and that has some other attributes, and I want to generate a dictionary from it, considering the key of the dictionary each of the values of the Atr1 (unique values, as I told before), and the values of the dict the values of the Atr2.</p>
  
  <p>Here is the Dataframe:</p>
  
  <pre><code>+------+------+------+------+
  | Atr1 | Atr2 | Atr3 | Atr4 |
  +------+------+------+------+
  |  'C' |  'B' |  21  |  'H' |
  +------+------+------+------+
  |  'D' |  'C' |  21  |  'J' |
  +------+------+------+------+
  |  'E' |  'B' |  21  |  'K' |
  +------+------+------+------+
  |  'A' |  'D' |  24  |  'I' |
  +------+------+------+------+
  </code></pre>
  
  <p>I want to get a Dictionary like this:</p>
  
  <pre><code>Dict -&gt; {'C': 'B', 'D': 'C', 'E': 'B', 'A': 'D'}
  </code></pre>
  
  <p>How could I do it?</p>