How can I create an array/list of dictionaries in python?
This is how I did it and it works:
dictlist = [dict() for x in range(n)]
It gives you a list of n empty dictionaries.
Use
weightMatrix = []for k in range(motifWidth): weightMatrix.append({'A':0,'C':0,'G':0,'T':0})