Я использую этот код для преобразования
Код: Выделить всё
my_dfКод: Выделить всё
@app.route('/result1', methods = ['GET'])
def ReturnJSON():
if(request.method == 'GET'):
my_df=...
response = {
"count" : len(my_df),
"output" : "ok",
}
response['result']=my_df.to_json(orient='records', force_ascii=False)
return response
Код: Выделить всё
{"count":10,"output":"ok","result":"[{\"Question\":\"-2 \\u062a\\...
Код: Выделить всё
{"count":10,"output":"ok","result":"[{"Question":"-2 \u062a\...
Источник: https://stackoverflow.com/questions/781 ... icode-json