I need some guidance on python pandas as it is an unknown territory for a frontend dev. I am familiar with the dataframes concept now. I was looking to find way to create a new dataframe by comparing two other dataframes. For this purpose, what should I be looking for in pandas?
For Example, consider df1 as
Date col1 col2 col3 id
2017-04-14 2482 1 0 a2
2017-04-15 2483 1 0 a3
and df2 as
Date col1 col2 col3 id
2017-04-15 2483 10 20 a3
2017-04-14 2482 11 0 a2
so what I am trying to achieve is create a new dataframe with details of values that are different like
Date df1_value df2_valuue diff_col_name val_diff id
2017-04-14 1 11 col2 -10 a2
2017-04-15 1 11 col2 -9 a3
2017-04-15 0 20 col3 20 a3
so I was able to join the two dfs based on id, df1.merge(df2, on='id', how='left')
, but what should be the next move. How do I compare the differences and create the final df?