Can anyone help please , here is the erreur code : TypeError: object of type 'map' has no len() #4
entropy = (map(lambda x: x.get_entropy(), pe.sections))
res['SectionsMeanEntropy'] = sum(entropy) / float(len(list(entropy)))
Can anyone help please , here is the erreur code : TypeError: object of type 'map' has no len() #4
entropy = (map(lambda x: x.get_entropy(), pe.sections))
res['SectionsMeanEntropy'] = sum(entropy) / float(len(list(entropy)))
Just convert entropy
to a list so you can use the len
function on it
entropy = list(map(lambda x: x.get_entropy(), pe.sections))
res['SectionsMeanEntropy'] = sum(entropy) / float(len(entropy))