How do I convert strings in CSV into integer in Pandas? for my supervised classification problem, 

I have a train dataset which contains past purchase data of customers and 5 new products are purchased by these customers. I have a test dataset which contains past purchase data of customers. They never bought from these 5 products.

I want to train a predictive model, I need to convert integer purchased data and new products. There are so many different products in my purchased data.





I saw that the mapping was made for true-false to convert 1-0, but in this case what can I do that?
You cannot convert your string product names to integers and expect    it to work, if you convert it to integers the algorithm you use will    expect a linear relationship between these integers, a relationship    that in fact does not exist.   

It is categorical data, and you should treat it like that, you have to one-hot encode it. If you have too many products to one-hot    encode all of them try grouping them in categories and then one-hot encoding the categories.