datafest competition 2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
431 B

import pandas as pd
# read in CSV
df = pd.read_csv('cleaned/wellness.csv')
# print out column uniques
print(df["Illness"].unique())
# make dictionary of unique values and their associated values
illness = {'No': 0, 'Slightly Off': 0.5, 'Yes': 1}
# iterate through new column vectorize
df["IllnessNum"] = [illness[item] for item in df["Illness"]]
df.to_csv('cleaned/wellness.csv')
print(df["Illness"])
print(df["IllnessNum"])