def make_ratings_hash(ratings):
    
    """
    Make a hashtable of ratings indexed by (userid,itemid)
    @param ratings: pandas.DataFrame of ratings
    @return a hashed version of the input ratings, which maps (userid, itemid) tuples
        to the relevant rating.
    """
    rhash = {}
    
    # for every 3-column row in the 3-column sub-dataset ratings[['userid','itemid','rating']],
    # use the values of the two first columns as the key and the third column value as the value.
    
    for _row_indx, (userid, itemid, rating) in ratings[['userid','itemid','rating']].iterrows():
        rhash[(userid,itemid)]=rating
    return rhash