Use pandas and pandas merge :
import pandas as pd
df = df1.merge(df2, on='value1', how= 'outer', suffixes=('_df1', '_df2'))
df['decrease'] = df['value2_df2'] < df['value2_df1']
giving:
value1 value2_df1 value2_df2 decrease
0 3900162750 10 9 True
1 3900163003 19 5 True
2 2311009200 22 88 False
Notes:
how parameter used to provide some output if df1 and df2 are not perfectly matching
suffixes parameter used to provide the origin of the data
- it could be suitable to give a other name to the
'decrease' column to remember the way it is computed
Data
from :
data1 = """
value1 value2
3900162750 10
3900163003 19
2311009200 22
"""
data2 = """
value1 value2
3900163003 5
3900162750 9
2311009200 88
"""
df1 = pd.read_csv(io.StringIO(data1), sep=r' +')
df2 = pd.read_csv(io.StringIO(data2), sep=r' +')
In real live read_csv should be replaced by read_excel
pandas. Find out how to find rows with a specific value. Compare the other value. Good luck.