0

I have panda data frame df:

Product_Code Date  Price
A            Jan    10.5
A            Dec    11.2
B            jun    8.1
...

Then there is dictionary which map every product_code to a unique product_Id like {(A:1},(B:2),...}. I want to apply this map to the df and convert product_code to product_Id:

df_new=df.replace({"Product_Code": mapp})

However it is very slow and take a lot of time for this conversion. Is there a better and efficient way to do it?

Thanks,

4

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.