# Row by row multiplication on pandas or numpy

I have one dataframe with classes and two components and a second one with elements and the same components. df1: df1 = pd.DataFrame({‘Class’:[‘banana’, ‘apple’], ‘comp1’:[1, 2], ‘comp2’:[-5, 4]}) df2: df2 = pd.DataFrame({‘Element’:[‘K’, ‘Mg’], ‘comp1’:[3, -4], ‘comp2’:[1, 3]}) I want to multiply them row by row in a way that would generate the following output: output… Read More Row by row multiplication on pandas or numpy