Can you please teach me to construct a dict from lists?
I have two lists:
A = [1, 2, 0, 0, 3]
and
B = ['HAM', 'SPAM', 'HAM', 'HAM', 'SPAM']
I want a dict like this:
Dict = [
... {'Count': 1., 'Class': 'HAM'},
... {'Count': 2., 'Class': 'SPAM'},
... {'Count': 0., 'Class': 'HAM'},
... {'Count': 0., 'Class': 'HAM'},
... {'Count': 3., 'Class': 'SPAM'},
... ]
Which include two feature keys 'Count' and 'Class' as well...
Much appreciated! Thanks.