Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pyspark-in-action committed Jan 21, 2016
2 parents 83bf9d7 + 682ce56 commit a63f504
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion top-N/top-N.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SparkContext available as sc.
>>> sc.parallelize(nums).takeOrdered(3, key=lambda x: -x)
[10, 9, 7]
>>>
>>> kv = >>> [(10,"z1"), (1,"z2"), (2,"z3"), (9,"z4"), (3,"z5"), (4,"z6"), (5,"z7"), (6,"z8"), (7,"z9")]
>>> kv = [(10,"z1"), (1,"z2"), (2,"z3"), (9,"z4"), (3,"z5"), (4,"z6"), (5,"z7"), (6,"z8"), (7,"z9")]
>>> sc.parallelize(kv).takeOrdered(3)
[(1, 'z2'), (2, 'z3'), (3, 'z5')]
>>>
Expand Down

0 comments on commit a63f504

Please sign in to comment.