sc = SparkContext(conf=conf)
data_file = sc.textData('file:///some_file.txt')
data_file = data_file.map(lambda l: l.split()).map(lambda l: (l[0], l[1],
    float(l[2])))
grouped = data_file.groupBy(lambda r: r[0])
group_list = grouped.map(lambda x: list(x[1]))
max_list = group_list.map(reduce_by_max).collect()
pyspark: grouby and then get max value of each group