0
$\begingroup$

I have used pd.get_dummies method to encode two categorical column. As a result of which i got dummy variable columns that should contain 0 and 1 but in my case they are showing True and False values. Please explain why this is happening? Is there anything wrong here?

$\endgroup$

1 Answer 1

0
$\begingroup$

Have you looked at the documentation? This is the default behaviour, if you want 0/1 values you need to set the output data type using the dtype argument to either int or float.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.