TypeError: cannot perform reduce with flexible type

I am getting this when I perform OneHotEncoder.

Can anyone please help me to fix this