i have 2 dictionary named ch_jaman and cdf950
ch jaman
{'Ancolmekar': array([0. , 0. , 0. , ..., 0. , 0. , 0.5]),
'Cidurian': array([0., 0., 0., ..., 0., 0., 0.]),
'Dayeuhkolot': array([0., 0., 0., ..., 0., 0., 0.]),
'Hantap': array([0., 0., 0., ..., 0., 0., 0.]),
'Kertasari': array([0., 0., 0., ..., 0., 0., 0.]),
'Meteolembang': array([0., 0., 0., ..., 0., 0., 0.]),
'Sapan': array([0., 0., 0., ..., 0., 0., 0.])}
cdf950
{'Ancolmekar': 15.5,
'Cidurian': 18.5,
'Dayeuhkolot': 5.5,
'Hantap': 14.0,
'Kertasari': 11.5,
'Meteolembang': 11.5,
'Sapan': 15.0}
i want to obtain biner 1,0 with condition. and this is my code that not yet working
for stas in ch_jaman:
for j in enumerate(ch_jaman):
if ch_jaman[stas]>=cdf950[stas]:
ch_jaman[j][stas] = 1
elif ch_jaman[stas]<cdf950[stas]:
ch_jaman[j][stas] = 0
and there was an error like this ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
what should i do. please help . thank you