In the example below (df name 'statement', column name 'product'), I want product 1 to be changed to product 2. I achieve this on the first line, but then the second line changes it from product 2 to product 18. Later, it changes from product 18 to product 13. How to perform all the loc operations given below in parallel. Instead of performing one after the other.
Example:
statement.loc[statement['product'] == 1, 'product'] = 2
statement.loc[statement['product'] == 2, 'product'] = 18
statement.loc[statement['product'] == 18, 'product'] = 13