title: Error using reducebykey: int object is unsubscriptable
body: <p>I'm getting an error <strong>"int object is unsubscriptable"</strong> while executing the following script :</p>
  
  <pre><code>element.reduceByKey( lambda x , y : x[1]+y[1])
  </code></pre>
  
  <p>with element is an key-value RDD and the value is a tuple. Example input:</p>
  
  <pre><code>(A, (toto , 10))
  (A, (titi , 30))
  (5, (tata, 10))
  (A, (toto, 10))
  </code></pre>
  
  <p>I understand that the <code>reduceByKey</code> function takes (K,V) tuples and apply a function on all the values to get the final result of the reduce.
  Like the example given in <a href="https://spark.apache.org/docs/2.2.0/rdd-programming-guide.html" rel="nofollow noreferrer">ReduceByKey Apache</a>.</p>
  
  <p>Any help please?</p>