Ad

Numeric Differences Between Two Different Dataframes In Python

- 1 answer

I would like to find the numeric difference between two or more columns of two different dataframe.

The following
Table 1
would be the starting table.
This one Table (Table 2)
enter image description here

contains the single values that I need to subtract to Table 1.

I would like to get a third table where I get the numeric differences between each row of Table 1 and the single row from Table 2. Any help?

Ad

Answer

Try

df.subtract(df2.values)

with df being your starting table and df2 being Table 2.

Ad
source: stackoverflow.com
Ad