I have 16 different dataframes with the same number of rows/columns and another 2 separate dataframes with that same shape that i'm using to compare with the 16 dataframe values.
I need to loop over all dataframes at the same time, and compare all row values with the separate dataframes, and then create another dataframe with the results like so:
comparison: sum(row_values_of_dataframe) - sum(row_values_of_reference)
. In the example below, the cell df_a_ref_a
is equal to $(1 + 2 + 3 + 4) - (5 + 5 + 5 + 5) = -10$
Dataframe A (df_a)
col1 | col 2 | col 3 | col 4
1 2 3 4
2 4 6 8
[...]
Dataframe B (df_b)
col1 | col 2 | col 3 | col 4
10 5 2 1
4 4 6 2
[...]
Reference Dataframe 1 (ref_1)
col1 | col 2 | col 3 | col 4
5 5 5 5
5 5 5 5
[...]
Reference Dataframe 2 (ref_2)
col1 | col 2 | col 3 | col 4
3 3 3 3
3 3 3 3
[...]
Final dataframe should be:
df_a_ref_1 | df_a_ref_2 | df_b_ref_1 | df_b_ref_2 | ....
-10 -2 -2 6 ....
0 8 -4 4
[...]
This behaviour resembles zip()
function in python.
Thanks in advance,