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

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