rdd = sc.parallelize([('user_1', 'object_1', 3), ('user_1', 'object_2', 2),
    ('user_2', 'object_1', 5), ('user_2', 'object_2', 2), ('user_2',
    'object_2', 6)])
Retrieve top n in each group of a DataFrame in pyspark