摘要:
In Python, a decorator is a design pattern that allows you to modify the functionality of a function by wrapping it in another function. The outer fun 阅读全文
摘要:
def counter(list): c_dict = {} for i in list: if i in c_dict: c_dict[i] += 1 else: c_dict[i] = 1 return c_dict def entropy(x): counts = counter(x) #每个 阅读全文