def get_r1_data(): data = utils.get_r1_data() city, confirm = [], [] for a, b in data: city.append(a) confirm.append(b) return jsonify({"city": city, "confirm": confirm})
def get_r1_data(): city = [] confirm = [] for a, b in utils.get_r1_data(): city.append(a) confirm.append(int(b)) return jsonify({"city": city, "confirm": confirm})
def get_r1_data(): data = utils.get_r1_data() city, confirm = [], [] for i in data: city.append(i[0]) confirm.append(int(i[1])) return jsonify({"city": city, "confirm": confirm})
def test_get_r1_data(self): ''' Test method get_r1_data() ''' self.assertEqual((('武汉', Decimal('50340')), ('香港', Decimal('5701')), ('孝感', Decimal('3518')), ('黄冈', Decimal('2907')), ('荆州', Decimal('1580'))), get_r1_data())
def get_r1_data(): data = utils.get_r1_data() prname, confirm = [], [] for pn, c in data: prname.append(pn) confirm.append(c) return jsonify({"prname": prname, "confirm": confirm})
def get_r1_data(): data = utils.get_r1_data() city, confirm = [], [] for k, v in data: city.append(k) confirm.append(int(v)) return jsonify({'city': city, 'confirm': confirm})
def get_r1_data(): data = utils.get_r1_data() city = [] confirm = [] for k,v in data: city.append(k) confirm.append(int(v)) return jsonify({"city": city, "confirm": confirm})
def get_r1_data(): data = utils.get_r1_data() list = [] for a, b, in data: list.append({"name": a, "value": b}) print("非湖北地区TOP5") print(list) return jsonify({"data": list})
def get_r1_data(): data = utils.get_r1_data() citys = [] confirms = [] for city, confirm in data: citys.append(city) confirms.append(int(confirm)) return jsonify({'city': citys, 'confirm': confirms})
def get_r1_data(): data=utils.get_r1_data() city=[] number=[] for i in data: city.append(i[0]) number.append(i[1]) return jsonify({"data":[city,number]})
def get_r1_data(): ak = [] av = [] alldata = utils.get_r1_data() let = len(alldata) for index in range(let): ak.append(alldata[index][0]) av.append(alldata[index][1]) return jsonify({"city": ak, "confirm": av})
def get_r1_data(): data = utils.get_r1_data() city, confirm = [], [] for a, b in data: if a != "地区待确认" and a != "境外输入": city.append(a) confirm.append(int(b)) return jsonify({"city": city[0:5], "confirm": confirm[0:5]})
def get_r1_data(): data = utils.get_r1_data() city = [] confirm = [] for i in data: city.append(i[0]) confirm.append(int(i[1])) return jsonify({'city': city, 'confirm': confirm})
def get_r1_data(): data = utils.get_r1_data() cost, time = [], [] for a, b in data[0::10]: cost.append(a) time.append(b[6:10]) return jsonify({"day": time, "cost": cost})
def get_r1_data(): data = utils.get_r1_data() count = [] count.append(['province', '本日新增', '现有确诊']) for a, b, c in data: count1 = [] count1.append(a) count1.append(int(b)) count1.append(int(c)) count.append(list(count1)) print(count) return jsonify({"data": count})
def get_r1_data(): data = utils.get_r1_data() day, confirm_add, dead_add = [], [], [] for a, b, c in data[5:]: day.append(a.strftime("%m-%d")) #a是datatime类型 confirm_add.append(b) dead_add.append(c) return jsonify({ "day": day, "confirm_add": confirm_add, "dead_add": dead_add })
def get_r1(): data = utils.get_r1_data() city, confirm = [], [] for a, b in data: city.append(a) confirm.append(b) return jsonify({ 'code': 200, 'message': 'ok', 'city': city, 'confirm': confirm, })