代碼不能理解
if?isinstance(max_features,?int): ????count?=?sorted(list(count.items()),?key=lambda?x:x[1]) ????if?max_features?is?not?None?and?len(count)?>?max_features: ????????count?=?count[-int(max_features):] ????for?w,?_?in?count: ????????self.dict[w]?=?len(self.dict) else: ????for?w?in?sorted(count.keys()): ????????self.dict[w]?=?len(self.dict) ???????? ?求這段代碼的理解
2020-08-05
Python
2019-05-27
剛開始是不能理解代碼的,原因是基礎(chǔ)知識不明白,去學基礎(chǔ)知識,再回來一個一個代碼分析,翻譯成能理解的邏輯。