I was trying to get dummy values for my data, when I noticed some values are having '?' as their value. As many rows in my data have these values, I simply cannot drop them. In such case what should I replace them with? Just taking the mode of the category will help? Also, I tried to replace the ? values with the mode.
df1 = df1[df1.workclass == '?'].replace('?',"Private")
But I get an empty table now.
It depends on the dataset. There are different methods that apply to different features. Some may require just replacing with the mode. In some cases, different ML algorithms and models are also used such as Random Forest, KNN, etc. So it completely depends on the type of data you are handling. Explore the field of data exploration. Maybe this can help you.