code: def _create_row_col_indices(ratings_df):
    
    user_id_to_user_idx = _create_index(ratings_df, "userId")
    item_id_to_item_idx = _create_index(ratings_df, "movieId")
  
    ratings_df["row"] = ratings_df["userId"].apply(
        lambda x: user_id_to_user_idx[x])
    ratings_df["col"] = ratings_df["movieId"].apply(
        lambda x: item_id_to_item_idx[x])
  
    return ratings_df
docs: Maps user and items ids to their locations in the rating matrix.