What is the output of the following PySpark code. myrdd = sc.parallelize([('a', 3), ('b', 2), ('c', 1)])
Fantastic news! We've Found the answer you've been seeking!
Question:
What is the output of the following PySpark code.
myrdd = sc.parallelize([('a', 3), ('b', 2), ('c', 1)])
myrdd.sortBy(lambda x:x[1], ascending=True).take(1)
Reference: pyspark.RDD.sortBy — PySpark 3.1.2 documentation(apache.org)
a.[('a', 3), ('b', 2), ('c', 1)]
b.[('a',3)]
c.[('c', 1)]
d.[('b', 2)]
Related Book For
Essentials of Contemporary Management
ISBN: ?978-0077439477
5th edition
Authors: Gareth Jones, Jennifer George
Posted Date: