python sumif在数据范围内具有一个条件
I'm working with two dataframes
- MRP:
Material | Description | Septiembre |
---|---|---|
1208181 | ADSV,NA,MX,ADH HOTMET 814433PM | 630.2888856 |
1206500 | SHWP,NA,MX,WRAP M-WRAP 18' | 459.4193011 |
3049172 | INSR,LUFTL,BR,LUFTAL | 0 |
3049173 | CLOS,LUFTL ,BR,Berry | 0 |
3060614 | Botl,Luftl,BR,LDPE/HDPE 15 ml | 0 |
- SMCALC:
材料 | 说明 | 品牌 | 可用数量可用 | 。 -6mth。 | 9月 |
---|---|---|---|---|---|
0324583 | ,蓝色,20ml | MCN | 921888 | 980554.96 | |
0327757 | CLOS,MUCNX,US,CR24MM | 9509400 | 6219256.172 | 407 | 1020442 |
对 | 氨基 | MCN | 38020.3542 | PIC | 1120252 |
TARTARIC | NA | 64203.289 | 乙酰 | 6784.4993 | MEAS |
,MUCNX, US | AICIC | 粉粉 | 43217.08 | 9370.0843 |
我正在excel中使用此公式:=+sumif(mrp!$ a:$ a,$ a2,mrp!c:c)
其中:
- range 是mrp !
-
-
f in smcalc
。
I'm working with two dataframes
- MRP:
Material | Description | Septiembre |
---|---|---|
1208181 | ADSV,NA,MX,ADH HOTMET 814433PM | 630.2888856 |
1206500 | SHWP,NA,MX,WRAP M-WRAP 18' | 459.4193011 |
3049172 | INSR,LUFTL,BR,LUFTAL | 0 |
3049173 | CLOS,LUFTL,BR,BERRY | 0 |
3060614 | BOTL,LUFTL,BR,LDPE/HDPE 15 ML | 0 |
- SMCalc:
Material | Description | Brand | Available Qty | Avail. - 6mth. | sep |
---|---|---|---|---|---|
0324583 | MEAS,MUCNX,US,BLUE,20ML | MCN | 921888 | 980554.96 | |
0327757 | CLOS,MUCNX,US,CR24MM | MCN | 9509400 | 6219256.172 | 975724.64 |
1019906 | ACETAMINOPHEN DC 90 COARSE L | TEM | 43900 | -4443.531438 | 7372.2407 |
1020442 | ACETAMINOPHEN POWDER | NA | 64203.289 | 38020.3542 | 6784.4993 |
1120252 | TARTARIC ACID | PIC | 43217.08 | 9370.0843 |
And I'm using this formula in excel: =+SUMIF(MRP!$A:$A,$A2,MRP!C:C)
where:
- Range is MRP!A:A (Material)
- Criteria is SMCalc $A2 (Material)
- Sum range is MRP!C:C (Septiembre)
The output I'm looking for is the column F in SMCalc
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“材料”匹配MRP中的MRP C列中的“ septiembre”总和。
如果我没有错,那Excel公式会在MRP中的 做:
在MRC中找到“ septiembre”的总和。然后将其与其他数据帧合并:
然后将这些值带回Smcalc,我们希望它们成为
If I'm not wrong, that excel formula calculates the sum of 'Septiembre' in column C of MRP when 'Material' in SMCalc matches 'Material' in MRP...
Assuming you have both excel sheets as pandas dataframes, I would then do:
To find the sum of 'Septiembre' per material in mrc. Then merge that with the other dataframe:
To then bring back those values to smcalc where we want them to be