title: PySpark - Combine DF columns into named StructType
body: <p>I'm looking to combine multiple columns of a PySpark Data Frame into one column of the <code>StructType</code>.</p>
  
  <p>Let's say I have a data frame like so:</p>
  
  <pre><code>columns = ['id', 'dogs', 'cats']
  vals = [(1, 2, 0),(2, 0, 1)]
  df = sqlContext.createDataFrame(vals, columns)
  </code></pre>
  
  <p>I'd like the resulting data frame to resemble this (not as it would actually be printed but to give an idea of what I mean if you aren't already familiar with StructType):</p>
  
  <pre><code>id | animals
  1  | dogs=2, cats=0
  2  | dogs=0, cats=1
  </code></pre>
  
  <p>Right now I am able to accomplish what I want with putting this:</p>
  
  <pre><code>StructType(
      [StructField('dogs', IntegerType(), True),
      [StructField('cats', IntegerType(), True)
  )
  </code></pre>
  
  <p>at the end of my <code>udf</code>s, however, I'd rather just do it with a single function. I'd be surprised if one doesn't exist.</p>