when mapping target variable, 'diabetes' (False patient has no diabetes, True patient has diabetes) to 0 (False) and 1 (True). All of entries come back as NaNs
I thought may be 'diabetes' isn't a true str and I need to convert to string first. Tried the following code:
diab_data['diabetes'] = diab_data['diabetes'].astype(str)
diab_data["diabetes"] = diab_data["diabetes"].map({'False':0, 'True':1})
I need values below to be either 0 (False) or 1 (True). All values return as NaN
Original Output:
patient diabetes
0 False
1 True
2 True
3 True
4 False
Output after mapping:
patient diabetes
0 NaN
1 NaN
2 NaN
3 NaN
4 NaN