Frequent pattern tree algorithm using Python