0

Input DataFrame: Input Dataframe

We have to swap the value in input data frame according to the value mentioned in Reference Table. Ref Table means (A>>1, B>>2, C>>3......)

Desired Output: Desired Output

dp1 = dp1.set_index('Ref')
for i in range(df1.shape[1]):
    df1.iloc[:,i] = df1.iloc[:,i].replace(dp1.iloc[:])

Join & Merge function does not work in this question.

It is not swapping the input table value. Please suggest where am I getting wrong or alternative method to do?

Community
  • 1
  • 1
  • It is not a duplicate question @jezrael. The solution which you have suggested does not resolve the problem which I have asked. Please have a look on query. – Vinit Sharma Apr 09 '20 at 08:45
  • OK, please add code from dupe, `merge` and `map` and show why not working. Because it seems not tested. – jezrael Apr 09 '20 at 08:46
  • 1
    Have used map method only with For Loop. It is working fine. Thanks – Vinit Sharma Apr 09 '20 at 09:28

0 Answers0