Я знаю, что эта ошибка распространена, я попробовал несколько решений, которые искал, но до сих пор не могу понять, в чем дело. Я предполагаю, что это связано с изменяемой формой row и row1, но я не могу этого понять.
Что я пытаюсь сделать?
У меня есть 2 кадра данных. Мне нужно перебрать строки первой 1, и для каждой строки первой перебрать вторую и проверить значение ячейки для некоторых столбцов.
Мой код и разные попытки:
a=0
b=0
for row in Correction.iterrows():
b+=1
for row1 in dataframe.iterrows():
c+=1
a=0
print('Handling correction '+str(b)+' and deal '+str(c))
if (Correction.loc[row,['BO Branch Code']]==dataframe.loc[row1,['wings Branch']] and Correction.loc[row,['Profit Center']]==dataframe.loc[row1,['Profit Center']] and Correction.loc[row,['Back Office']]==dataframe.loc[row1,['Back Office']]
and Correction.loc[row,['BO System Code']]==dataframe.loc[row1,['BO System Code']]):
Я тоже пробовал
a=0
b=0
for row in Correction.iterrows():
b+=1
for row1 in dataframe.iterrows():
c+=1
a=0
print('Handling correction '+str(b)+' and deal '+str(c))
if (Correction[row]['BO Branch Code']==dataframe[row1]['wings Branch'] and Correction[row]['Profit Center']==dataframe[row1]['Profit Center'] and Correction[row]['Back Office']==dataframe[row1]['Back Office']
and Correction[row]['BO System Code']==dataframe[row1]['BO System Code']):
И
a=0
b=0
for row in Correction.iterrows():
b+=1
for row1 in dataframe.iterrows():
c+=1
a=0
print('Handling correction '+str(b)+' and deal '+str(c))
if (Correction.loc[row,['BO Branch Code']]==dataframe[row1,['wings Branch']] and Correction[row,['Profit Center']]==dataframe[row1,['Profit Center']] and Correction[row,['Back Office']]==dataframe[row1,['Back Office']]
and Correction[row,['BO System Code']]==dataframe[row1,['BO System Code']]):
Подробнее здесь: https://stackoverflow.com/questions/425 ... -be-hashed
TypeError: объекты «Series» изменяемы, поэтому их нельзя хешировать. ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
TypeError: объекты «серии» изменяются, поэтому они не могут быть хэшированы
Anonymous » » в форуме Python - 0 Ответы
- 50 Просмотры
-
Последнее сообщение Anonymous
-
-
-
TypeError: объекты «серии» изменяются, поэтому они не могут быть хэшированы
Anonymous » » в форуме Python - 0 Ответы
- 4 Просмотры
-
Последнее сообщение Anonymous
-