ratings_df = sqlContext.createDataFrame([('97990079', '18_34', 2), (
    '585853655', '11_8', 1), ('1398696913', '6_20', 1), ('612168869',
    '7_16', 1), ('2272846159', '11_17', 2)], ('user_id', 'item_id_str',
    'rating'))
Transform input data for ALS in pyspark