This commit is contained in:
parent
921682687c
commit
d16ddc872e
3
main.py
3
main.py
|
@ -3,7 +3,6 @@ import getopt
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import re
|
import re
|
||||||
import math
|
import math
|
||||||
import json
|
|
||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request
|
||||||
from flask_cors import CORS
|
from flask_cors import CORS
|
||||||
from pypinyin import pinyin, lazy_pinyin, Style
|
from pypinyin import pinyin, lazy_pinyin, Style
|
||||||
|
@ -224,7 +223,7 @@ def get_max_group(all_idiom, group, num):
|
||||||
ret_list = group.nlargest(num, ['pinyin_c', 'frequency']).index.tolist()
|
ret_list = group.nlargest(num, ['pinyin_c', 'frequency']).index.tolist()
|
||||||
result = list()
|
result = list()
|
||||||
for i in ret_list:
|
for i in ret_list:
|
||||||
result.append(json.loads(all_idiom.loc[i].to_json(orient = 'index',force_ascii=False)))
|
result.append(all_idiom.loc[i].to_dict())
|
||||||
return result
|
return result
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
pandas
|
pandas
|
||||||
pypinyin
|
pypinyin
|
||||||
|
flask==1.1
|
||||||
|
flask-cors
|
||||||
|
|
Loading…
Reference in New Issue