I am experimenting with a dataset and I have a couple of columns with high cardinality. So, I performed mean target encoding (given that my dataset had more than 50000 observations). But, before doing this, I split my data (using Pandas) into training and test and then encoded them. After checking, I realized that my training and testing datasets had Nan's. Since you can not run an ML algorithm with Nan's, I decided to impute both of them with MissForest.
My question is: Is what I have done acceptable?