Skip to content

Commit

Permalink
update fpGrowth.py 更新has_key写法
Browse files Browse the repository at this point in the history
has_key在Python3中的语法已经去除。用in来代替
  • Loading branch information
wnma3mz authored Jun 1, 2018
1 parent 99a059c commit 9dee2d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/py3.x/ML/12.FrequentPattemTree/fpGrowth.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def loadSimpDat():
def createInitSet(dataSet):
retDict = {}
for trans in dataSet:
if not retDict.has_key(frozenset(trans)):
if frozenset(trans) not in retDict.keys():
retDict[frozenset(trans)] = 1
else:
retDict[frozenset(trans)] += 1
Expand Down

0 comments on commit 9dee2d8

Please sign in to comment.