Proper use of get_dummies function in pandas

python

#1

I don’t fully understand the use of get_dummies function. How is it different from One hot encoding?

Also, if I use get_dummies on train data, it is always not reproducible on test set. How could I do this?