Error in onehot encoder

I am not able to solve this error, I tried the above solution given by sir also but the error was still same.

Hey, can you share the link to your notebook?

Facing the same error despite trying out the method suggested by sir.
link to my notebook: mujtabakhurram2/jovian-1 - Jovian

Worked my way around it by the following way. Hope this helps others.
Looking forward to why the method suggest by sir wasn’t working.

1 Like

This is probably a version issue of either Pandas/scikit-learn library.