One hot encoding in Python
you have 2 seperate sheets ( for test and train data set). you have to one-hot encode both the sheets seperately after importing it into the pandas data frame.
and YES one hot encoding will be the same for the same data set no matter you apply on different data sheets, make sure you have same categorical values in that column in each of your data sheet
I'm trying to learn machine learning. 
I had a doubt about one hot encoding:
I have a data set split into 2 excel sheets of data. One sheet has train and other has test data. I first trained my model by importing the train data sheet with pandas. There are categorical features in the data set that have to be encoded. I one hot encoded them.  
After importing the test dataset , if I one hot encode it, will the encoding be the same as of the train data set or will it be different. If so, how can I solve this issue?