python 연습

9554 단어
from pyecharts import options as opts
from pyecharts.charts import *
import pandas as pd
data = pd.read_excel('./ 2 17 22 37 .xlsx', encoding='ansi')
mask = data[" "] == data[" "]
data = data.loc[mask , :]
res = data.loc[:,[" "," "]]
data_pair=res.values.tolist()
print(data_pair)
mapchina = Map()
mapchina.add(series_name = " ",
             data_pair= data_pair,
             maptype="china"
)
mapchina.set_global_opts(visualmap_opts=opts.VisualMapOpts(
    is_piecewise=True,
    pieces=[
        {
     "min": 10001, "label": ">10000", "color": "#4b0101"},
        {
     "max": 10000, "min": 5001, "label": ">5000", "color": "#4a0100"},
        {
     "max": 5000, "min": 1001, "label": ">1000", "color": "#8A0808"},
        {
     "max": 1000, "min": 500, "label": "500-1000", "color": "#B40404"},
        {
     "max": 499, "min": 100, "label": "100-499", "color": "#DF0101"},
        {
     "max": 99, "min": 10, "label": "10-99", "color": "#F78181"},
        {
     "max": 9, "min": 1, "label": "1-9", "color": "#F5A9A9"},
        {
     "max": 0, "label": "0", "color": "#FFFFFF"}]
))
mapchina.render(" .html")

좋은 웹페이지 즐겨찾기