I have two dataframes with following structure:
dfA = pd.DataFrame({
"Run": (
1, 1, 1, 2, 2, 2, 3, 3, 3
),
"Point": (
1, 2, 3, 1, 2, 3, 1, 2, 3
),
"Val": (
78, 79, 77, 78, 79, 77, 78, 79, 77
)
})
and
dfB = pd.DataFrame({
"Run": (
1, 1, 1, 2, 2, 2, 3, 3, 3,
),
"Point": (
1, 2, 3, 1, 2, 3, 1, 2, 3,
),
"Val": (
68, 69, 67, 68, 69, 67, 68, 69, 67,
),
})
With
result_df = dfA.compare(dfB, keep_equal=True, keep_shape=True).rename(columns={'self': 'A', 'other': 'B'}, level=-1)
I got this table-like output:
Run Point Val
A B A B A B
0 1 1 1 1 78 68
1 1 1 2 2 79 69
2 1 1 3 3 77 67
3 2 2 1 1 78 68
4 2 2 2 2 79 69
5 2 2 3 3 77 67
6 3 3 1 1 78 68
7 3 3 2 2 79 69
8 3 3 3 3 77 67
Is there a way to put this result_df in a AG grid table?
Thanks!