I am trying to assign a value to a cell dataframe in python. I create a new column called RepEvnumb in my dataframe dd . I don't know what I am doing wrong because the value of the cell didn't change. I am getting this message error : "ValueError: cannot set using a multi-index selection indexer with a different length than the value" I hope someone can help me. Thank you
dd['RepEvnumb'] =''
dd['RepEvnumb'] = dd['RepEvnumb'].astype('object')
b=[{'group_id': 'E1', 'subjects_affected': '0', 'subjects_at_risk': '104'},
{'group_id': 'E2', 'subjects_affected': '0', 'subjects_at_risk': '105'}]
dd.iloc[0,'RepEvnumb']=[dic['subjects_affected'] for dic in b]