Answers for "pandas replace if conditions"

1

pandas replace values based on condition

df.loc[df['First Season'] > 1990, 'First Season'] = 1
Posted by: Guest on May-23-2021
0

replace pandas column values based on condition

d.loc[d["conditionDisplayName"] == "Brand New", "conditionDisplayName"] = 6
d.loc[d["conditionDisplayName"] != "Brand New", "conditionDisplayName"] = 4
Posted by: Guest on April-08-2022

Code answers related to "pandas replace if conditions"

Python Answers by Framework

Browse Popular Code Answers by Language