if k is not None:
        recs = recs[recs["rank"] <= k]