I have a csv file which contains date, location and health status.
Date Location Health 2018-02-11 DELHI OK 2018-02-11 MUMBAI not responding 2018-02-11 KOLKATA ok 2018-02-11 PUNE ok 2018-02-11 CHENNAI not responding 2018-02-11 NOIDA OK 2018-02-11 GURGAON not responding 2018-02-11 CHANDIGARH ok
I want the strings
ok in the Health column to be capitalized but as you can see, there are certain lowercase representations as well.How do I ensure the lowercase string
ok is changed to upercase string
I have used this function below
df = pd.read_csv("metrics.csv", parse_dates=["date"]) df['Health'].replace("ok", "OK", inplace=True)
But it still shows the lowercase ok.What am I doing wrong?python-3.xpandas