Python笔记:模拟百度大数据,绘制一幅“广州春运期间人口迁徙图”
很多数据分析玩家都知道,百度大数据还是非常厉害的,尤其是在绘制地图方面。百度的地图应该使用JavaScript来做的,而我选择Python。其实两者可能同宗。 # 1.导入相关的库 from pyecharts.charts import Geo import pyecharts.options as opts # 2.模拟数据 city_num = [("广州",105),("成都",70),("北京",99), ("西安",80),("杭州",60),("贵阳",34), ("上海",65),("深圳",54),("乌鲁木齐",76), ("哈尔滨",47),("兰州",56),("信阳",85)] start_end = [("广州","成都"),("广州","北京"),("广州","西安"), ("广州","杭州"),("广州","贵阳"),("广州","上海"), ("广州","深圳"),("广州","乌鲁木齐"),("广州","哈尔滨"), ("广州","兰州"),("广州","信阳")] ( # 3.初始化地图类 Geo(init_opts = opts.InitOpts(width = "800px",height = "500px",theme = "blue")) .add_schema(maptype = "china", itemstyle_opts