我得到警告:SettingWithCopyWarning: 试图在DataFrame的切片副本上设置一个值
到目前为止,在使用.loc进行更改时,我没有得到积极的结果
'''Dictionary
terms = { 'Restaurants': ['GASTHOF', 'GASTHAUS', 'CAFE',],
'Lohn/Gehalt': ['MERLIN'],
'Lebensmittel': ['LIDL', 'EUROSPAR'],
'Handy': ['A1 Telekom', 'Drei Austria', 'HUTCHISON'],
'Parkkosten': ['NaN'],
'Kraftstoff': ['TANKSTELLE', 'TANKE', 'JET']}
'''
'''
for i in terms.keys():
j = terms[i]
frame['Zuweisung'][frame['Buchungstext'].str.contains('|'.join(map(re.escape, j )))] = i
'''
我必须如何重写代码 '''frame ['Zuweisung'] [frame ['Buchungstext']。str.contains('|'.join(map(re.escape,j)))] = i''没有得到'SettingWithCopyWarning'>