|
|
@ -51,7 +51,7 @@ def dict_sort(_dict, _key, _reverse=False): |
|
|
|
result_val_dict = {} |
|
|
|
result_val_dict = {} |
|
|
|
for rv in result: |
|
|
|
for rv in result: |
|
|
|
result_val_dict[rv[0]] = rv[1] |
|
|
|
result_val_dict[rv[0]] = rv[1] |
|
|
|
|
|
|
|
# print(result_val_dict) |
|
|
|
return result_val_dict |
|
|
|
return result_val_dict |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -59,6 +59,7 @@ def dict_rate(_dict): |
|
|
|
_sum = reduce((lambda x, y: x + y), _dict.values()) |
|
|
|
_sum = reduce((lambda x, y: x + y), _dict.values()) |
|
|
|
for k, v in _dict.items(): |
|
|
|
for k, v in _dict.items(): |
|
|
|
_dict[k] = str(round(v / _sum * 100, 2)) + '%' |
|
|
|
_dict[k] = str(round(v / _sum * 100, 2)) + '%' |
|
|
|
|
|
|
|
# print(_dict) |
|
|
|
return _dict |
|
|
|
return _dict |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|