say I have two dfs: df1:
| new_col | attribute | y1 |
|---|---|---|
| petrol | car | 0.3 |
| diesel | car | 0.4 |
| rigid | hgv | 0.25 |
| artic | hgv | 0.35 |
the other data frame (df2) has the attribute column from df1 in common:
| id | car | hgv |
|---|---|---|
| 1 | 10 | 1000 |
| 2 | 1000 | 10 |
| 3 | 100 | 10000 |
I am trying to add the names of new_col from df1 as new columns in df2 and populate it by multiplying y1/y2 by the corresponding attribute column in df2 for y1 and y2.
