Multiply each element of a column by each element of a different dataframe
This will work. Here we are manipulating numpy array inside the DataFrame.
pd.DataFrame(df1.values*df2.values, columns=df1.columns, index=df1.index)
I have two data frame both having same number of columns but the first data frame has multiple rows and the second one has only one row but same number of columns as the first one. I need to multiply the entries of the first data frame with the second by column name.
DF:1
  A   B   C
0  34  54  56
1  12  87  78
2  78  35   0
3  84  25  14
4  26  82  13
DF:2
A  B  C
0  2  3  1
Result
A     B    C
68   162  56
24   261  78
156  105   0
168   75  14
52   246  13