У меня есть 2 кадра данных, как показано ниже: DF1 и DF2
DF1: я импортирую это из файла Excel.
DF1
Product % to be applied in Exp
0 00028 0.1080
1 00031 0.2067
2 00045 0.3469
3 00089 0.1877
4 00099 0.1507
5 Total 1.0000
DF2 : I am importing this from an Excel file which contains thousand of Expanses details. How ever i am only taking 3 rows for my calculation.
DF2
Account CC Account Dis Exp Amount
0 523761 US12 Admin Exp 50000.12
1 578212 9999 Travle Exp 89673.89
2 578511 0234 Rent 50202.99
Out put :I want out put as below. each row of Exp Amount of DF2 must be splited by each product by its % from DF1. Is there any way around to solve this calculations ?
Output
>>> Output
Account CC Account Dis Product Exp Amount
0 523761 US12 Admin Exp 28 5400.012960
1 523761 US12 Admin Exp 31 10335.024804
2 523761 US12 Admin Exp 45 17345.041628
3 523761 US12 Admin Exp 89 9385.022524
4 523761 US12 Admin Exp 99 7535.018084
5 578212 9999 Travle Exp 28 9684.780120
6 578212 9999 Travle Exp 31 18535.593063
7 578212 9999 Travle Exp 45 31107.872441
8 578212 9999 Travle Exp 89 16831.789153
9 578212 9999 Travle Exp 99 13513.855223
10 578511 0234 Rent 28 5421.922920
11 578511 0234 Rent 31 10376.958033
12 578511 0234 Rent 45 17415.417231
13 578511 0234 Rent 89 9423.101223
14 578511 0234 Rent 99 7565.590593
введите описание изображения здесь