[問題] pandas 條件加總

作者: a5170040 (Andy)   2019-01-11 21:09:46
我有一組資料如下
Vendor Document Date Clearing Date Invoice_Amount
0 A 09/13/2016 11/04/2016 2,007,324.85
1 A 04/18/2016 07/11/2016 631,714.68
2 A 09/13/2016 09/16/2016 4,000,000.00
3 A 07/11/2017 09/23/2017 5,000,000.00
4 A 05/03/2016 06/17/2016 2,000,000.00
作者: Luluemiko (露露)   2019-01-11 22:08:00
def test(row): six_month = Document Date - ....return df.loc[(df["Vendor"] == Vendor)....df['Sum_Paid'] = df.apply(test, axis = 1)
作者: a5170040 (Andy)   2019-01-13 22:46:00
好像不行耶...能再提示的更完整些嗎?多謝L大的回答
作者: Luluemiko (露露)   2019-01-13 23:57:00
我誤解了,因為有作搜尋,所以我的寫法是錯的

Links booklink

Contact Us: admin [ a t ] ucptt.com