aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/streaming/network_wordjoinsentiments.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/main/python/streaming/network_wordjoinsentiments.py')
-rw-r--r--examples/src/main/python/streaming/network_wordjoinsentiments.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/src/main/python/streaming/network_wordjoinsentiments.py b/examples/src/main/python/streaming/network_wordjoinsentiments.py
index b85517dfdd..b309d9fad3 100644
--- a/examples/src/main/python/streaming/network_wordjoinsentiments.py
+++ b/examples/src/main/python/streaming/network_wordjoinsentiments.py
@@ -67,8 +67,8 @@ if __name__ == "__main__":
# with the static RDD inside the transform() method and then multiplying
# the frequency of the words by its sentiment value
happiest_words = word_counts.transform(lambda rdd: word_sentiments.join(rdd)) \
- .map(lambda (word, tuple): (word, float(tuple[0]) * tuple[1])) \
- .map(lambda (word, happiness): (happiness, word)) \
+ .map(lambda word_tuples: (word_tuples[0], float(word_tuples[1][0]) * word_tuples[1][1])) \
+ .map(lambda word_happiness: (word_happiness[1], word_happiness[0])) \
.transform(lambda rdd: rdd.sortByKey(False))
happiest_words.foreachRDD(print_happiest_words)