I am trying to impute values in my dataset conditionally.
Say I have three columns, If Column 1 is 1 then Column 2 is 0 and Column 3 is 0; If column 1 is 2 then Column 2 is Mean () and Column 3 is Mean().
I tried running an if statement with the function any() and defined the conditions separately.
However the conditions are not being fulfilled based on conditions, I am either getting all mean values or all zeroes.
I have posted this on Stackoverflow and haven’t gotten any response to help me with this. Please do suggest what should I apply to get this sorted.
Thanks a lot!
Aucun commentaire:
Enregistrer un commentaire