How do I invert key and value in RDD in Python 3 pyspark?
<p>This works in Python 2.7, but in Python 3.5 it returns</p>

<blockquote>
  <p>SyntaxError: invalid syntax.</p>
</blockquote>

<p>I'm not sure if this has to do with the fact that "tuple unpacking" was removed from Python 3, as I read on another post, or is a different issue.  </p>

<pre><code>rddInverted = rdd.map(lambda (x,y): (y,x))
</code></pre>