python地图热力图随机经纬度格式生成器,配合地图热力图程序“食用”更佳哦~

import re
import random
for a in range(0,10):
    lat = str(random.randint(25,40))
    lng = str(random.randint(90,120))
    count = str(random.randint(1,100))
    print(\'{"count": %s, "lat": %s, "lng":%s},\' %(count,lat,lng))

运行结果:

{"count": 19, "lat": 28, "lng":104},
{"count": 77, "lat": 37, "lng":95},
{"count": 3, "lat": 25, "lng":107},
{"count": 1, "lat": 33, "lng":91},
{"count": 16, "lat": 36, "lng":119},
{"count": 73, "lat": 32, "lng":119},
{"count": 1, "lat": 30, "lng":117},
{"count": 96, "lat": 34, "lng":117},
{"count": 51, "lat": 27, "lng":117},
{"count": 16, "lat": 31, "lng":97},

 

版权声明:本文为helenlee01原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/helenlee01/p/12617451.html