pyecharts写大数据相关岗位人才需求城市分布map地图
时间: 2023-06-27 22:03:03 浏览: 118
好的,以下是使用pyecharts制作大数据相关岗位人才需求城市分布map地图的示例代码:
```python
from pyecharts.charts import Map
from pyecharts import options as opts
import pandas as pd
# 读取数据
data = pd.read_excel('data.xlsx', sheet_name='Sheet1')
# 提取城市和需求量数据
city_data = data[['city', 'demand']].values.tolist()
# 绘制地图
map_chart = Map()
map_chart.add(
series_name="",
data_pair=city_data,
maptype="china",
label_opts=opts.LabelOpts(is_show=False),
is_map_symbol_show=False,
)
map_chart.set_global_opts(
title_opts=opts.TitleOpts(title="大数据相关岗位人才需求城市分布"),
visualmap_opts=opts.VisualMapOpts(max_=2000),
)
map_chart.render("map.html")
```
其中,需要提前准备好数据文件(示例数据文件名为data.xlsx),包含城市和需求量两列数据。代码中使用pandas库进行数据读取和处理,使用pyecharts的Map组件绘制地图,并设置相应的样式和全局选项。最后将地图保存为html文件。
需要注意的是,需要安装pyecharts库和相应的地图组件及其依赖,具体可参考pyecharts官方文档。
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)