d.loc[d["conditionDisplayName"] == "Brand New", "conditionDisplayName"] = 6 d.loc[d["conditionDisplayName"] != "Brand New", "conditionDisplayName"] = 4