title: How to zip two column in pyspark?
body: <p>I use: <code>Python 3.6</code> and <code>PySpark 2.3.0</code>. In the following exaple I have only tow items in <code>item</code> but also I can have more information like <code>first_name</code>, <code>last_name</code>, <code>city</code>.</p>
  
  <p>I have a data frame with the following schema:</p>
  
  <pre><code>|-- email: string (nullable = true)
  | -- item: struct(nullable=true)
  | | -- item: array(nullable=true)
  | | | -- element: struct(containsNull=true)
  | | | | -- data: string(nullable=true)
  | | | | -- fieldid: string(nullable=true)
  | | | | -- fieldname: string(nullable=true)
  | | | | -- fieldtype: string(nullable=true)
  </code></pre>
  
  <p>This is my output:</p>
  
  <pre><code>+-----+-----------------------------------------------------------------------------------------+
  |email|item                                                                                     |
  +-----+-----------------------------------------------------------------------------------------+
  |x    |[[[Gmail, 32, Email Client, dropdown], [Device uses Proxy Server, 33, Device, dropdown]]]|
  |y    |[[[IE, 32, Email Client, dropdown], [Personal computer, 33, Device, dropdown]]]          |
  +-----+-----------------------------------------------------------------------------------------+
  </code></pre>
  
  <p>I want to transform this data frame to:</p>
  
  <pre><code>+-----+-------------------------------------+
  |email|Email Client|Device                  |
  +-----+-------------------------------------+
  |x    |Gmail       |Device uses Proxy Server|
  |y    |IE          |Personal computer       |
  +-----+-------------------------------------+
  </code></pre>
  
  <p>I do some transformations:</p>
  
  <pre><code>df = df.withColumn('item', df.item.item)
  df = df.withColumn('column_names', df.item.fieldname)
  df = df.withColumn('column_values', df.item.data)
  </code></pre>
  
  <p>And now my output is:</p>
  
  <pre><code>+-----+----------------------+---------------------------------+
  |email|column_names          |column_values                    |
  +-----+----------------------+---------------------------------+
  |x    |[Email Client, Device]|[Gmail, Device uses Proxy Server]|
  |y    |[Email Client, Device]|[IE, Personal computer]          |
  +-----+----------------------+---------------------------------+
  </code></pre>
  
  <p>From here I want a method how to zip these columns.</p>