我想使用来自另一列的多个值的组合在我的数据框中创建一个新列。
我尝试了以下代码,但似乎不起作用。我可以看到接线员没有工作。
enter code here
lst = [df1]
for column in lst:
column.loc[(column["booking_text"] in ['SEPA-Gutschrift','SEPA-Cash
Management Gutsch','FASTER PAYMENTS','SCHECK-EV','BACS CREDIT','POS
Gutschrift','Scheckeinreichung e.V.'])
& (column["debit_credit"] == 'Credit'), "financial_category"] = 'Reveunue_Credit'
df1['financial_category'] = df1['financial_category']
ValueError:系列的真值不明确。使用 a.empty、a.bool()、a.item()、a.any() 或 a.all()。
lst = [df1]
for column in lst:
column.loc[(column["booking_text"].isin(['SEPA-Gutschrift','SEPA-Cash Management
Gutsch','FASTER PAYMENTS', 'SCHECK-EV','BACS CREDIT','POS
Gutschrift','Scheckeinreichung e.V.'])) & (column["debit_credit"] == 'Credit'), 'financial_category'] = 'Reveunue_Credit'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句