django 使用pandas和numpy的map,where() 做数据统计并将数据转成数组传给前端
增加查询效率
import numpy as np
import pandas as pd
from django.http import JsonResponse
def districtstatistics(req):
apply_num=xxxxxx.objects.all() #
distrcs = list(xxxxxx.objects.all().values('name')) # 区域名称
df = pd.DataFrame(distrcs)
...
原创
2021-03-29 18:05:54 ·
1012 阅读 ·
1 评论