I would like to multiply two columns of a df by following a specific pattern without using a loop. I have this df :
num m d
0 8 5
1 2 3
2 17 8
The idea is to multply for each row in 'm' every row in 'd' except the one with the same 'num'. The resulting df would be :
num1 num2 mult
0 1 8x3 = 24
0 2 8x8 = 64
1 2 2x8 = 16
Is there a way to do that ?
Thank for your help
numcolumn have repeated values?