title: Transposing a Spark DataFrame from row to column in PySpark and appending it with another DataFrame
body: <p>I have a Spark DataFrame in PySpark <code>avg_length_df</code> that looks like - </p>
  
  <pre><code>+----------------+---------+----------+-----------+---------+-------------+----------+
  |       id       |        x|         a|          b|        c|      country|     param|
  +----------------+---------+----------+-----------+---------+-------------+----------+
  |            40.0|      9.0|     5.284|      5.047|    6.405|         13.0|avg_length|
  +----------------+---------+----------+-----------+---------+-------------+----------+
  </code></pre>
  
  <p>I want to transpose it from row to column so that it becomes - </p>
  
  <pre><code>+----------+
  |avg_length|
  +----------+
  |      40.0|
  |       9.0|
  |     5.284|
  |     5.047|
  |     6.405|
  |      13.0|
  +----------+
  </code></pre>
  
  <p>Next, I have a second DataFrame <code>df2</code>:</p>
  
  <pre><code>+----------------+------+
  |       col_names|dtypes|
  +----------------+------+
  |              id|string|
  |               x|   int|
  |               a|string|
  |               b|string|
  |               c|string|
  |         country|string|
  +----------------+------+
  </code></pre>
  
  <p>I want to create a column <code>avg_length</code> in <code>df2</code> the equals to the transposed DataFrame above. So the expected output would look like: </p>
  
  <pre><code>+----------------+------+----------+
  |       col_names|dtypes|avg_length|
  +----------------+------+----------+
  |              id|string|      40.0|
  |               x|   int|       9.0|
  |               a|string|     5.284|
  |               b|string|     5.047|
  |               c|string|     6.405|
  |         country|string|      13.0|
  +----------------+------+----------+
  </code></pre>
  
  <p>How do I complete the 2 operations? </p>