【四 (5)数据可视化之 Pyecharts常用图表及代码实现 】

目录

    • 文章导航
    • 一、介绍
    • [✨ 特性]
    • 二、安装Pyecharts
    • 三、主题风格
    • 四、占比类图表
      • 1、饼图
      • 2、环形图
      • 3、玫瑰图
      • 4、玫瑰图-多图
      • 5、堆叠条形图
      • 6、百分比堆叠条形图
    • 五、比较排序类
      • 1、条形图
      • 2、雷达图
      • 3、词云图
      • 4、漏斗图
    • 六、趋势类图表
      • 1、折线图
      • 2、堆叠折线图
      • 3、面积图
      • 4、堆叠面积图
    • 七、频率分布类
      • 1、直方图
      • 2、箱线图
    • 八、关系类图表
      • 1、散点图
      • 2、多图例散点图
      • 3、气泡图
      • 4、热力图
    • 九、地理类图表
      • 1、地图
    • 十、突出类图表
      • 1、仪表盘
    • 十一、组合图表
      • 1、overlap
      • 2、grid-并行多图
      • 3、page-顺序多图
      • 4、tab-选项卡多图
      • 5、timeline-时间线轮播多图

文章导航

【一 简明数据分析进阶路径介绍(文章导航)】

一、介绍

Echarts 是一个由百度开源的数据可视化,凭借着良好的交互性,精巧的图表设计,得到了众多开发者的认可。而 Python 是一门富有表达力的语言,很适合用于数据处理。当数据分析遇上数据可视化时,pyecharts 诞生了。

[✨ 特性]

  • 简洁的 API 设计,使用如丝滑般流畅,支持链式调用
  • 囊括了 30+ 种常见图表,应有尽有
  • 支持主流 Notebook 环境,Jupyter Notebook 和 JupyterLab
  • 可轻松集成至 Flask,Django 等主流 Web 框架
  • 高度灵活的配置项,可轻松搭配出精美的图表
  • 详细的文档和示例,帮助开发者更快的上手项目
  • 多达 400+ 地图文件以及原生的百度地图,为地理数据可视化提供强有力的支持

二、安装Pyecharts

pip install pyecharts

三、主题风格

pyecharts有多种风格,可参考
https://pyecharts.org/#/zh-cn/themes

四、占比类图表

1、饼图

from pyecharts import options as opts
from pyecharts.charts import Pie
import pandas as pd  
from pyecharts.globals import ThemeType

df = pd.read_csv('train.csv')

# 按'SaleCondition'字段统计记录数  
sale_condition_counts = df['SaleCondition'].value_counts().reset_index()  
sale_condition_counts.columns = ['SaleCondition', 'Count']  
  
# 将统计结果转换为列表,用于pyecharts饼图  
data_pair = [(row['SaleCondition'], row['Count']) for index, row in sale_condition_counts.iterrows()] 

c = (
    Pie(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add("", data_pair)
    #.set_colors(["blue", "green", "yellow", "red", "pink", "orange", "purple"])
    .set_global_opts(title_opts=opts.TitleOpts(title="饼图"))
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
)
# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

2、环形图

from pyecharts import options as opts
from pyecharts.charts import Pie
import pandas as pd  
from pyecharts.globals import ThemeType

df = pd.read_csv('train.csv')

# 按'SaleCondition'字段统计记录数  
sale_condition_counts = df['SaleCondition'].value_counts().reset_index()  
sale_condition_counts.columns = ['SaleCondition', 'Count']  
  
# 将统计结果转换为列表,用于pyecharts饼图  
data_pair = [(row['SaleCondition'], row['Count']) for index, row in sale_condition_counts.iterrows()] 

c = (
    Pie(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add("", data_pair, radius=["40%", "75%"])
    #.set_colors(["blue", "green", "yellow", "red", "pink", "orange", "purple"])
    .set_global_opts(title_opts=opts.TitleOpts(title="环形图"))
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
)
# 渲染图表到notebook  
c.render_notebook()

在这里插入图片描述

3、玫瑰图

from pyecharts import options as opts
from pyecharts.charts import Pie
import pandas as pd  
from pyecharts.globals import ThemeType

df = pd.read_csv('train.csv')

# 按'SaleCondition'字段统计记录数  
sale_condition_counts = df['SaleCondition'].value_counts().reset_index()  
sale_condition_counts.columns = ['SaleCondition', 'Count']  
  
# 将统计结果转换为列表,用于pyecharts饼图  
data_pair = [(row['SaleCondition'], row['Count']) for index, row in sale_condition_counts.iterrows()] 

c = (
    Pie(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add("", data_pair, 
         radius=["40%", "75%"],
         rosetype="area") #radius/area
    .set_global_opts(title_opts=opts.TitleOpts(title="玫瑰图"))
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
)
# 渲染图表到notebook  
c.render_notebook()

在这里插入图片描述

4、玫瑰图-多图

from pyecharts import options as opts
from pyecharts.charts import Pie
import pandas as pd  
from pyecharts.globals import ThemeType

df = pd.read_csv('train.csv')

# 按'SaleCondition'字段统计记录数  
sale_condition_counts = df['SaleCondition'].value_counts().reset_index()  
sale_condition_counts.columns = ['SaleCondition', 'Count']  
  
# 将统计结果转换为列表,用于pyecharts饼图  
data_pair = [(row['SaleCondition'], row['Count']) for index, row in sale_condition_counts.iterrows()] 

c = (
    Pie(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add("", data_pair, 
         radius=["40%", "75%"],
         center=["25%", "50%"],
         rosetype="area") #radius/area
    .add("", data_pair, 
         radius=["40%", "75%"],
         center=["75%", "50%"],
         rosetype="area") #radius/area
    .set_global_opts(title_opts=opts.TitleOpts(title="玫瑰图-多图"))
    .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))
)
# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

5、堆叠条形图

from pyecharts import options as opts
from pyecharts.charts import Bar
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv')  
  
result = df.groupby('YrSold').agg({  
    'OverallQual': 'sum',  
    'GarageCars': 'sum',  
    'FullBath': 'sum'  
}).reset_index()  
  
result.columns = ['YrSold', 'OverallQual', 'GarageCars', 'FullBath']  

result_sorted_des = result.sort_values('YrSold', ascending=True)

xaxis = result_sorted_des['YrSold'].tolist()
yaxis_1 = result_sorted_des['OverallQual'].tolist()
yaxis_2 = result_sorted_des['GarageCars'].tolist()
yaxis_3 = result_sorted_des['FullBath'].tolist()

c = (
    Bar(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(xaxis)
    .add_yaxis("商家A", yaxis_1, stack="stack1")
    .add_yaxis("商家B", yaxis_2, stack="stack1")
    .add_yaxis("商家C", yaxis_3, stack="stack1")
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
    .set_global_opts(title_opts=opts.TitleOpts(title="堆叠条形图"))
)
# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

6、百分比堆叠条形图

from pyecharts import options as opts  
from pyecharts.charts import Bar  
import pandas as pd    
from pyecharts.globals import ThemeType  
  
# 读取数据并处理  
df = pd.read_csv('train.csv')    
result = df.groupby('YrSold').agg({    
    'OverallQual': 'sum',    
    'GarageCars': 'sum',    
    'FullBath': 'sum'    
}).reset_index()    
result.columns = ['YrSold', 'OverallQual', 'GarageCars', 'FullBath']    
result_sorted_des = result.sort_values('YrSold', ascending=True)  
  
# 计算每个年份的累计和  
total_per_year = result_sorted_des[['OverallQual', 'GarageCars', 'FullBath']].sum(axis=1)  
  
# 计算每个特征的百分比  
result_sorted_des['OverallQual_pct'] = (result_sorted_des['OverallQual'] / total_per_year).round(2) * 100  
result_sorted_des['GarageCars_pct'] = (result_sorted_des['GarageCars'] / total_per_year).round(2) * 100  
result_sorted_des['FullBath_pct'] = (result_sorted_des['FullBath'] / total_per_year).round(2) * 100  
  
# 提取数据用于图表  
xaxis = result_sorted_des['YrSold'].tolist()  
yaxis_1 = result_sorted_des['OverallQual_pct'].tolist()  
yaxis_2 = result_sorted_des['GarageCars_pct'].tolist()  
yaxis_3 = result_sorted_des['FullBath_pct'].tolist()  
  
# 创建百分比堆叠条形图  
c = (  
    Bar(init_opts=opts.InitOpts(theme=ThemeType.WALDEN))  
    .add_xaxis(xaxis)  
    .add_yaxis("OverallQual", yaxis_1, stack="stack1")  
    .add_yaxis("GarageCars", yaxis_2, stack="stack1")  
    .add_yaxis("FullBath", yaxis_3, stack="stack1")  
    .set_series_opts(label_opts=opts.LabelOpts(is_show=True, position="right",formatter="{c}%", rotate=0))  # 显示百分比  
    .set_global_opts(tooltip_opts=opts.TooltipOpts(is_show=True, trigger="item"),
                     title_opts=opts.TitleOpts(title="百分比堆叠条形图"))  
)  
  
# 渲染图表到notebook  
c.render_notebook() 

在这里插入图片描述

五、比较排序类

1、条形图

from pyecharts import options as opts
from pyecharts.charts import Bar
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv')  
  
result = df.groupby('YrSold').agg({  
    'OverallQual': 'sum',  
    'GarageCars': 'sum',  
    'FullBath': 'sum'  
}).reset_index()  
  
result.columns = ['YrSold', 'OverallQual', 'GarageCars', 'FullBath']  
  
result_sorted_desc = result.sort_values('YrSold', ascending=False)
    
xaxis = result_sorted_desc['YrSold'].tolist()
yaxis_1 = result_sorted_desc['OverallQual'].tolist()
yaxis_2 = result_sorted_desc['GarageCars'].tolist()
yaxis_3 = result_sorted_desc['FullBath'].tolist()

c = (
    Bar(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(xaxis)
    .add_yaxis("商家A", yaxis_1)
    .add_yaxis("商家B", yaxis_2)
    .add_yaxis("商家C", yaxis_3)
#     .reversal_axis()  # 坐标轴反转
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
    .set_global_opts(title_opts=opts.TitleOpts(title="条形图"))
)
# 渲染图表到notebook  
c.render_notebook() 

在这里插入图片描述

2、雷达图

from pyecharts import options as opts
from pyecharts.charts import Radar
from pyecharts.globals import ThemeType  

v1 = [[4300, 10000, 28000, 35000, 50000, 19000]]
v2 = [[5000, 14000, 28000, 31000, 42000, 21000]]
c = (
    Radar(init_opts=opts.InitOpts(theme=ThemeType.WALDEN))
    .add_schema(
        schema=[
            opts.RadarIndicatorItem(name="销售", max_=6500),
            opts.RadarIndicatorItem(name="管理", max_=16000),
            opts.RadarIndicatorItem(name="信息技术", max_=30000),
            opts.RadarIndicatorItem(name="客服", max_=38000),
            opts.RadarIndicatorItem(name="研发", max_=52000),
            opts.RadarIndicatorItem(name="市场", max_=25000),
        ]
    )
    .add("预算分配", v1,areastyle_opts=opts.AreaStyleOpts(opacity=0.1,color="#CD0000"),linestyle_opts=opts.LineStyleOpts(color="#CD0000"))
    .add("实际开销", v2,areastyle_opts=opts.AreaStyleOpts(opacity=0.2,color="#5CACEE"),linestyle_opts=opts.LineStyleOpts(color="#5CACEE"))
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
    .set_global_opts(
        #legend_opts=opts.LegendOpts(selected_mode="single"),
        title_opts=opts.TitleOpts(title="雷达图"),
    )
    
)

# 渲染图表到notebook  
c.render_notebook() 

在这里插入图片描述

3、词云图

from pyecharts import options as opts
from pyecharts.charts import WordCloud
from pyecharts.globals import SymbolType


words = [
    ("Sam S Club", 10000),
    ("Macys", 6181),
    ("Amy Schumer", 4386),
    ("Jurassic World", 4055),
    ("Charter Communications", 2467),
    ("Chick Fil A", 2244),
    ("Planet Fitness", 1868),
    ("Pitch Perfect", 1484),
    ("Express", 1112),
    ("Home", 865),
    ("Johnny Depp", 847),
    ("Lena Dunham", 582),
    ("Lewis Hamilton", 555),
    ("KXAN", 550),
    ("Mary Ellen Mark", 462),
    ("Farrah Abraham", 366),
    ("Rita Ora", 360),
    ("Serena Williams", 282),
    ("NCAA baseball tournament", 273),
    ("Point Break", 265),
]
c = (
    WordCloud(init_opts=opts.InitOpts(theme=ThemeType.WALDEN))
    .add("", words, word_size_range=[20, 100], shape=SymbolType.DIAMOND)
    .set_global_opts(title_opts=opts.TitleOpts(title="词云图"))
)

# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

4、漏斗图

import pyecharts.options as opts
from pyecharts.charts import Funnel

x_data = ["展现", "点击", "访问", "咨询", "订单"]
y_data = [100, 80, 60, 40, 20]

data = [[x_data[i], y_data[i]] for i in range(len(x_data))]

c = (
    Funnel()
    .add(
        series_name="",
        data_pair=data,
        gap=2,
        tooltip_opts=opts.TooltipOpts(trigger="item", formatter="{b} : {c}%"),
        label_opts=opts.LabelOpts(is_show=True, position="inside"),
        itemstyle_opts=opts.ItemStyleOpts(border_color="#fff", border_width=1),
    )
    .set_global_opts(title_opts=opts.TitleOpts(title="漏斗图", subtitle="漏斗图"))
    .set_series_opts(label_opts=opts.LabelOpts(is_show=True, position="right",formatter="{c}", rotate=0))  # 显示内容
)

# 渲染图表到notebook  
c.render_notebook() 

在这里插入图片描述

六、趋势类图表

1、折线图

from pyecharts import options as opts
from pyecharts.charts import Line
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv')  
  
result = df.groupby('YrSold').agg({  
    'OverallQual': 'sum',  
    'GarageCars': 'sum',  
    'FullBath': 'sum'  
}).reset_index()  
  
result.columns = ['YrSold', 'OverallQual', 'GarageCars', 'FullBath']  
  
result_sorted_desc = result.sort_values('YrSold', ascending=False)
    
xaxis = result_sorted_desc['YrSold'].tolist()
xaxis = [str(i) for i in xaxis]  #x轴不能用数字 
yaxis_1 = result_sorted_desc['OverallQual'].tolist()
yaxis_2 = result_sorted_desc['GarageCars'].tolist()
yaxis_3 = result_sorted_desc['FullBath'].tolist()

c = (
    Line(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(xaxis)
    .add_yaxis("OverallQual", yaxis_1)
    .add_yaxis("GarageCars", yaxis_2)
    .add_yaxis("FullBath", yaxis_3)
    #.set_series_opts(label_opts=opts.LabelOpts(is_show=False))
    .set_global_opts(title_opts=opts.TitleOpts(title="折线图"))
)
# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

2、堆叠折线图

from pyecharts import options as opts
from pyecharts.charts import Line
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv')  
  
result = df.groupby('YrSold').agg({  
    'OverallQual': 'sum',  
    'GarageCars': 'sum',  
    'FullBath': 'sum'  
}).reset_index()  
  
result.columns = ['YrSold', 'OverallQual', 'GarageCars', 'FullBath']  
  
result_sorted_desc = result.sort_values('YrSold', ascending=False)
    
xaxis = result_sorted_desc['YrSold'].tolist()
xaxis = [str(i) for i in xaxis]  #x轴不能用数字 
yaxis_1 = result_sorted_desc['OverallQual'].tolist()
yaxis_2 = result_sorted_desc['GarageCars'].tolist()
yaxis_3 = result_sorted_desc['FullBath'].tolist()

c = (
    Line(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(xaxis_data=xaxis)
    .add_yaxis(
        series_name="OverallQual",
        stack="总量",
        y_axis=yaxis_1,
#         areastyle_opts=opts.AreaStyleOpts(opacity=0.5),
        label_opts=opts.LabelOpts(is_show=False),
    )
    .add_yaxis(
        series_name="GarageCars",
        stack="总量",
        y_axis=yaxis_2,
#         areastyle_opts=opts.AreaStyleOpts(opacity=0.5),
        label_opts=opts.LabelOpts(is_show=False),
    )
    .add_yaxis(
        series_name="FullBath",
        stack="总量",
        y_axis=yaxis_3,
#         areastyle_opts=opts.AreaStyleOpts(opacity=0.5),
        label_opts=opts.LabelOpts(is_show=False),
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(title="堆叠折线图"),
        tooltip_opts=opts.TooltipOpts(trigger="axis", axis_pointer_type="cross"),
        yaxis_opts=opts.AxisOpts(
            type_="value",
            axistick_opts=opts.AxisTickOpts(is_show=True),
            splitline_opts=opts.SplitLineOpts(is_show=True),
        ),
        xaxis_opts=opts.AxisOpts(type_="category", boundary_gap=False),
    )
)
# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

3、面积图

from pyecharts import options as opts
from pyecharts.charts import Line
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv')  
  
result = df.groupby('YrSold').agg({  
    'OverallQual': 'sum',  
    'GarageCars': 'sum',  
    'FullBath': 'sum'  
}).reset_index()  
  
result.columns = ['YrSold', 'OverallQual', 'GarageCars', 'FullBath']  
  
result_sorted_desc = result.sort_values('YrSold', ascending=False)
    
xaxis = result_sorted_desc['YrSold'].tolist()
xaxis = [str(i) for i in xaxis]  #x轴不能用数字 
yaxis_1 = result_sorted_desc['OverallQual'].tolist()
yaxis_2 = result_sorted_desc['GarageCars'].tolist()
yaxis_3 = result_sorted_desc['FullBath'].tolist()

c = (
    Line(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(xaxis)
    .add_yaxis("OverallQual", yaxis_1, areastyle_opts=opts.AreaStyleOpts(opacity=0.5))
    .add_yaxis("GarageCars", yaxis_2, areastyle_opts=opts.AreaStyleOpts(opacity=0.5))
    .add_yaxis("FullBath", yaxis_3, areastyle_opts=opts.AreaStyleOpts(opacity=0.5))
    #.set_series_opts(label_opts=opts.LabelOpts(is_show=False))
    .set_global_opts(title_opts=opts.TitleOpts(title="面积图"))
)
# 渲染图表到notebook  
c.render_notebook() 

在这里插入图片描述

4、堆叠面积图

from pyecharts import options as opts
from pyecharts.charts import Line
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv')  
  
result = df.groupby('YrSold').agg({  
    'OverallQual': 'sum',  
    'GarageCars': 'sum',  
    'FullBath': 'sum'  
}).reset_index()  
  
result.columns = ['YrSold', 'OverallQual', 'GarageCars', 'FullBath']  
  
result_sorted_desc = result.sort_values('YrSold', ascending=False)
    
xaxis = result_sorted_desc['YrSold'].tolist()
xaxis = [str(i) for i in xaxis]  #x轴不能用数字 
yaxis_1 = result_sorted_desc['OverallQual'].tolist()
yaxis_2 = result_sorted_desc['GarageCars'].tolist()
yaxis_3 = result_sorted_desc['FullBath'].tolist()

c = (
    Line(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(xaxis_data=xaxis)
    .add_yaxis(
        series_name="OverallQual",
        stack="总量",
        y_axis=yaxis_1,
        areastyle_opts=opts.AreaStyleOpts(opacity=0.5),
        label_opts=opts.LabelOpts(is_show=False),
    )
    .add_yaxis(
        series_name="GarageCars",
        stack="总量",
        y_axis=yaxis_2,
        areastyle_opts=opts.AreaStyleOpts(opacity=0.5),
        label_opts=opts.LabelOpts(is_show=False),
    )
    .add_yaxis(
        series_name="FullBath",
        stack="总量",
        y_axis=yaxis_3,
        areastyle_opts=opts.AreaStyleOpts(opacity=0.5),
        label_opts=opts.LabelOpts(is_show=False),
    )
    .set_global_opts(
        title_opts=opts.TitleOpts(title="堆叠面积图"),
        tooltip_opts=opts.TooltipOpts(trigger="axis", axis_pointer_type="cross"),
        yaxis_opts=opts.AxisOpts(
            type_="value",
            axistick_opts=opts.AxisTickOpts(is_show=True),
            splitline_opts=opts.SplitLineOpts(is_show=True),
        ),
        xaxis_opts=opts.AxisOpts(type_="category", boundary_gap=False),
    )
)
# 渲染图表到notebook  
c.render_notebook() 

在这里插入图片描述

七、频率分布类

1、直方图

from pyecharts import options as opts
from pyecharts.charts import Bar
from pyecharts.faker import Faker

df = pd.read_csv('train.csv').head(100)

sale_condition_counts = df['YearBuilt'].value_counts().reset_index()  
sale_condition_counts.columns = ['YearBuilt', 'Count']

x_data = sale_condition_counts.YearBuilt.tolist()
y_data = sale_condition_counts.Count.tolist()


c = (
    Bar(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(x_data)
    .add_yaxis("Count", y_data, category_gap=0)
    .set_global_opts(title_opts=opts.TitleOpts(title="直方图"))
)

# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

2、箱线图

from pyecharts import options as opts
from pyecharts.charts import Boxplot

v1 = [
    [850, 740, 900, 1070, 930, 850, 950, 980, 980, 880, 1000, 980],
    [960, 940, 960, 940, 880, 800, 850, 880, 900, 840, 830, 790],
]
v2 = [
    [890, 810, 810, 820, 800, 770, 760, 740, 750, 760, 910, 920],
    [890, 840, 780, 810, 760, 810, 790, 810, 820, 850, 870, 870],
]

c = (
    Boxplot(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(["expr1", "expr2"])
    .add_yaxis("A", v1)
    .add_yaxis("B", v2)
    .set_global_opts(title_opts=opts.TitleOpts(title="箱线图"))
)

# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

八、关系类图表

1、散点图

from pyecharts import options as opts
from pyecharts.charts import Scatter
from pyecharts.faker import Faker
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv').head(100)  
df = df.sort_values('GrLivArea', ascending=True)
df[['SalePrice', 'OverallQual', 'GrLivArea', 'GarageCars', 'TotalBsmtSF', 'FullBath', 'YearBuilt']]
x_data = df.GrLivArea.to_list()
x_data = [str(i) for i in x_data]  #x轴不能用数字 
y_data = df.SalePrice.to_list()

c = (
    Scatter(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(x_data)
    .add_yaxis("GrLivArea", y_data)
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False, position="right",formatter="{c}", rotate=0))    
    .set_global_opts(
        title_opts=opts.TitleOpts(title="散点图"),
        visualmap_opts=opts.VisualMapOpts(max_=500000, min_=100000),
    )
)

# 渲染图表到notebook  
c.render_notebook() 

在这里插入图片描述

2、多图例散点图

from pyecharts import options as opts
from pyecharts.charts import Scatter
from pyecharts.faker import Faker
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv').head(100)  
df = df.sort_values('GrLivArea', ascending=True)
df[['SalePrice', 'OverallQual', 'GrLivArea', 'GarageCars', 'TotalBsmtSF', 'FullBath', 'YearBuilt']]
x_data = df.SalePrice.to_list()
x_data = [str(i) for i in x_data]  #x轴不能用数字 
y_data = df.GrLivArea.to_list()
y_data1 = df.YearBuilt.to_list()

c = (
    Scatter(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(x_data)
    .add_yaxis("GrLivArea", y_data)
    .add_yaxis("YearBuilt", y_data1)
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False, position="right",formatter="{c}", rotate=0))    
    .set_global_opts(
        title_opts=opts.TitleOpts(title="散点图"),
        visualmap_opts=opts.VisualMapOpts(max_=500000, min_=100000),
    )
)

# 渲染图表到notebook  
c.render_notebook()  

在这里插入图片描述

3、气泡图

from pyecharts import options as opts
from pyecharts.charts import Scatter
from pyecharts.faker import Faker
import pandas as pd  
from pyecharts.globals import ThemeType
  
df = pd.read_csv('train.csv').head(100)  
df = df.sort_values('GrLivArea', ascending=True)
df[['SalePrice', 'OverallQual', 'GrLivArea', 'GarageCars', 'TotalBsmtSF', 'FullBath', 'YearBuilt']]
x_data = df.GrLivArea.to_list()
x_data = [str(i) for i in x_data]  #x轴不能用数字 
y_data = df.SalePrice.to_list()

c = (
    Scatter(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add_xaxis(x_data)
    .add_yaxis("GrLivArea", y_data)
    .set_series_opts(label_opts=opts.LabelOpts(is_show=False, position="right",formatter="{c}", rotate=0))    
    .set_global_opts(
        title_opts=opts.TitleOpts(title="气泡图"),
        visualmap_opts=opts.VisualMapOpts(type_="size",max_=500000, min_=100000),
    )
)

# 渲染图表到notebook  
c.render_notebook()

在这里插入图片描述

4、热力图

from pyecharts.charts import HeatMap  
from pyecharts import options as opts  
import pandas as pd  
  
# 读取CSV文件的前100行  
df = pd.read_csv('train.csv').head(100)  
  
# 选择你关心的列  
df_date = df[['SalePrice', 'OverallQual', 'GrLivArea', 'GarageCars', 'TotalBsmtSF', 'FullBath', 'YearBuilt']]  
  
# 计算相关性矩阵,确保没有缺失值  
correlation_matrix = df_date.corr().dropna(axis=0, how='any').dropna(axis=1, how='any')  

# 初始化一个空列表来存储三元组  
triplets = []  
   
for i in range(correlation_matrix.shape[0]):  
    for j in range(correlation_matrix.shape[1]):  
        # 获取 x 坐标(列名)和 y 坐标(列名)  
        x = i  
        y = j 
        # 获取数据值(相关性系数)  
        value = round(correlation_matrix.iloc[i, j], 2)
        triplets.append((x, y, value))          

# 创建热力图  
c = (  
    HeatMap(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))  
    .add_xaxis(correlation_matrix.columns.tolist())  
    .add_yaxis(  
        "相关性",  
        correlation_matrix.index.tolist(),  
        triplets,  
        label_opts=opts.LabelOpts(is_show=True, position="inside"),  
    )  
    .set_global_opts(  
        title_opts=opts.TitleOpts(title="热力图"),  
        visualmap_opts=opts.VisualMapOpts(min_=-1, max_=1),  # 设置最小值和最大值以反映相关性范围  
    )  
)  
  
# 渲染图表到notebook  
c.render_notebook()

在这里插入图片描述

九、地理类图表

1、地图

from pyecharts import options as opts
from pyecharts.charts import Map
from pyecharts.faker import Faker

x_data = ['杭州市','衢州市','湖州市','嘉兴市','宁波市','绍兴市','台州市','温州市','丽水市','金华市','舟山市']
y_data = [4000,2000,1800,2100,3500,3000,3000,3500,1500,2000,1000]

c = (
    Map(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))
    .add("销量", [list(z) for z in zip(x_data, y_data)], "浙江")
    .set_series_opts(label_opts=opts.LabelOpts(is_show=True, position="center",formatter="{b}{c}", rotate=0))    
    .set_global_opts(
        title_opts=opts.TitleOpts(title="地图"),
        visualmap_opts=opts.VisualMapOpts(max_=4000),
    )
)

# 渲染图表到notebook  
c.render_notebook()

在这里插入图片描述

十、突出类图表

1、仪表盘

from pyecharts import options as opts  
from pyecharts.charts import Gauge  
from pyecharts.globals import ThemeType
  
# 创建并配置Gauge实例  
gauge = (  
    Gauge(init_opts=opts.InitOpts( theme=ThemeType.WALDEN))  
    .add(  
        "业务指标",  
        [("完成率", 55.5)],  
        split_number=5,  
        axisline_opts=opts.AxisLineOpts(  
            linestyle_opts=opts.LineStyleOpts(  
                color=[(0.3, "#67e0e3"), (0.7, "#37a2da"), (1, "#fd666d")], width=30  
            )  
        ),  
        detail_label_opts=opts.LabelOpts(formatter="{value}"),  
    )  
    .set_global_opts(  
        title_opts=opts.TitleOpts(title="仪表盘"),  
        legend_opts=opts.LegendOpts(is_show=False),  
    )  
)  
  
# 渲染图表到notebook  
gauge.render_notebook()  

在这里插入图片描述

十一、组合图表

1、overlap

import pandas as pd
from pyecharts.globals import ThemeType
from pyecharts.charts import Line, Grid
from pyecharts import options as opts
from pyecharts.charts import Bar

周期 = ['202340', '202341', '202342', '202343', '202344', '202345', '202346', '202347', '202348', '202349', '202350', '202351']
浏览 = ['20', '49', '53', '57', '43', '52', '56', '60', '80', '56', '59', '35']
点击 = ['4', '14', '4', '2', '13', '7', '6', '5', '11', '4', '8', '0']
购买 = ['0', '0', '1', '0', '3', '1', '1', '1', '1', '3', '3', '1']
总量 = ['24', '63', '58', '59', '59', '60', '63', '66', '92', '63', '70', '36']

bar = (
    Bar(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis('浏览', 浏览, stack='stack1', color='#5aa5b4', category_gap="40%")
        .add_yaxis('点击', 点击, stack='stack1', color='#FFFF00', category_gap="40%")
        .add_yaxis('购买', 购买, stack='stack1', color='#FF6347', category_gap="40%")
        .set_series_opts(label_opts=opts.LabelOpts(position="right",
                                                   formatter='{c}'))
        .set_global_opts(title_opts=opts.TitleOpts(title='overlap'),
                         # xaxis_opts=opts.AxisOpts(name='地市'),
                         # visualmap_opts=opts.VisualMapOpts(max_=150),
                         # toolbox_opts=opts.ToolboxOpts(),
                         #  datazoom_opts=opts.DataZoomOpts(),
                         xaxis_opts=opts.AxisOpts(name_rotate=60, axislabel_opts={"rotate": 45})
                         )
)

line = (
    Line(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis(
        "总量",
        总量,
        # markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
#         markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(y=38)]),
    )
        .set_global_opts(title_opts=opts.TitleOpts(title=""))
)

overlap1 = bar.overlap(line)
overlap1.render_notebook()

在这里插入图片描述

2、grid-并行多图

import pandas as pd
from pyecharts.globals import ThemeType
from pyecharts.charts import Line, Grid
from pyecharts import options as opts
from pyecharts.charts import Bar

周期 = ['202340', '202341', '202342', '202343', '202344', '202345', '202346', '202347', '202348', '202349', '202350', '202351']
浏览 = ['20', '49', '53', '57', '43', '52', '56', '60', '80', '56', '59', '35']
点击 = ['4', '14', '4', '2', '13', '7', '6', '5', '11', '4', '8', '0']
购买 = ['0', '0', '1', '0', '3', '1', '1', '1', '1', '3', '3', '1']
总量 = ['24', '63', '58', '59', '59', '60', '63', '66', '92', '63', '70', '36']

bar = (
    Bar(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis('浏览', 浏览, stack='stack1', color='#5aa5b4', category_gap="40%")
        .add_yaxis('点击', 点击, stack='stack1', color='#FFFF00', category_gap="40%")
        .add_yaxis('购买', 购买, stack='stack1', color='#FF6347', category_gap="40%")
        .set_series_opts(label_opts=opts.LabelOpts(position="right",
                                                   formatter='{c}'))
        .set_global_opts(title_opts=opts.TitleOpts(title='并行多图'),
                         # xaxis_opts=opts.AxisOpts(name='地市'),
                         # visualmap_opts=opts.VisualMapOpts(max_=150),
                         # toolbox_opts=opts.ToolboxOpts(),
                         #  datazoom_opts=opts.DataZoomOpts(),
                         xaxis_opts=opts.AxisOpts(name_rotate=60, axislabel_opts={"rotate": 45})
                         )
)

line = (
    Line(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis(
        "总量",
        总量,
        # markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
#         markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(y=38)]),
    )
        .set_global_opts(title_opts=opts.TitleOpts(title=""))
)



grid = (
    Grid(init_opts=opts.InitOpts(width="860px", height="600px", theme=ThemeType.LIGHT))
        .add(bar, grid_opts=opts.GridOpts(pos_top="50%", pos_right="10%"))
        .add(line, grid_opts=opts.GridOpts(pos_left="10%", pos_bottom="50%"))
)

grid.render_notebook()

在这里插入图片描述

3、page-顺序多图

from pyecharts.charts import Page
import pandas as pd
from pyecharts.globals import ThemeType
from pyecharts.charts import Line, Tab
from pyecharts import options as opts
from pyecharts.charts import Bar

周期 = ['202340', '202341', '202342', '202343', '202344', '202345', '202346', '202347', '202348', '202349', '202350', '202351']
浏览 = ['20', '49', '53', '57', '43', '52', '56', '60', '80', '56', '59', '35']
点击 = ['4', '14', '4', '2', '13', '7', '6', '5', '11', '4', '8', '0']
购买 = ['0', '0', '1', '0', '3', '1', '1', '1', '1', '3', '3', '1']
总量 = ['24', '63', '58', '59', '59', '60', '63', '66', '92', '63', '70', '36']

bar = (
    Bar(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis('浏览', 浏览, stack='stack1', color='#5aa5b4', category_gap="40%")
        .add_yaxis('点击', 点击, stack='stack1', color='#FFFF00', category_gap="40%")
        .add_yaxis('购买', 购买, stack='stack1', color='#FF6347', category_gap="40%")
        .set_series_opts(label_opts=opts.LabelOpts(position="right",
                                                   formatter='{c}'))
        .set_global_opts(title_opts=opts.TitleOpts(title='顺序多图'),d
                         # xaxis_opts=opts.AxisOpts(name='地市'),
                         # visualmap_opts=opts.VisualMapOpts(max_=150),
                         # toolbox_opts=opts.ToolboxOpts(),
                         #  datazoom_opts=opts.DataZoomOpts(),
                         xaxis_opts=opts.AxisOpts(name_rotate=60, axislabel_opts={"rotate": 45})
                         )
)

line = (
    Line(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis(
        "总量",
        总量,
        # markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
#         markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(y=38)]),
    )
        .set_global_opts(title_opts=opts.TitleOpts(title=""))
)

def page_draggable_layout():
    # page = Page(layout=Page.SimplePageLayout)  #  不可拖动
    page = Page(layout=Page.DraggablePageLayout)  # 可拖动
    page.add(
        bar,
        line
    )
    page.render_notebook()
    page.render("C:/Users/Mirror/Desktop/下载/pyecharts/顺序多图.html")  


if __name__ == "__main__":
    page_draggable_layout()

在这里插入图片描述

4、tab-选项卡多图

import pandas as pd
from pyecharts.globals import ThemeType
from pyecharts.charts import Line, Tab
from pyecharts import options as opts
from pyecharts.charts import Bar

周期 = ['202340', '202341', '202342', '202343', '202344', '202345', '202346', '202347', '202348', '202349', '202350', '202351']
浏览 = ['20', '49', '53', '57', '43', '52', '56', '60', '80', '56', '59', '35']
点击 = ['4', '14', '4', '2', '13', '7', '6', '5', '11', '4', '8', '0']
购买 = ['0', '0', '1', '0', '3', '1', '1', '1', '1', '3', '3', '1']
总量 = ['24', '63', '58', '59', '59', '60', '63', '66', '92', '63', '70', '36']

bar = (
    Bar(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis('浏览', 浏览, stack='stack1', color='#5aa5b4', category_gap="40%")
        .add_yaxis('点击', 点击, stack='stack1', color='#FFFF00', category_gap="40%")
        .add_yaxis('购买', 购买, stack='stack1', color='#FF6347', category_gap="40%")
        .set_series_opts(label_opts=opts.LabelOpts(position="right",
                                                   formatter='{c}'))
        .set_global_opts(title_opts=opts.TitleOpts(title='选项卡多图'),
                         # xaxis_opts=opts.AxisOpts(name='地市'),
                         # visualmap_opts=opts.VisualMapOpts(max_=150),
                         # toolbox_opts=opts.ToolboxOpts(),
                         #  datazoom_opts=opts.DataZoomOpts(),
                         xaxis_opts=opts.AxisOpts(name_rotate=60, axislabel_opts={"rotate": 45})
                         )
)

line = (
    Line(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))
        .add_xaxis(周期)
        .add_yaxis(
        "总量",
        总量,
        # markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
#         markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(y=38)]),
    )
        .set_global_opts(title_opts=opts.TitleOpts(title=""))
)

tab = Tab()
tab.add(bar, "bar-example")
tab.add(line, "line-example")

tab.render_notebook()

在这里插入图片描述

5、timeline-时间线轮播多图

import pandas as pd
from pyecharts.globals import ThemeType
from pyecharts.charts import Timeline, Pie
from pyecharts import options as opts
dict ={
'202212': [['电脑', 1], ['电视', 13], ['冰箱', 8],['空调', 8],['洗衣机', 8]], 
'202301': [['电脑', 2], ['电视', 12], ['冰箱', 5],['空调', 3],['洗衣机', 8]], 
'202302': [['电脑', 3], ['电视', 11], ['冰箱', 8],['空调', 18],['洗衣机', 8]], 
'202303': [['电脑', 4], ['电视', 10], ['冰箱', 8],['空调', 8],['洗衣机', 2]], 
'202304': [['电脑', 5], ['电视', 9], ['冰箱', 8],['空调', 8],['洗衣机', 8]], 
'202305': [['电脑', 6], ['电视', 8], ['冰箱', 9],['空调', 8],['洗衣机', 8]], 
'202306': [['电脑', 7], ['电视', 7], ['冰箱', 8],['空调', 7],['洗衣机', 5]], 
'202307': [['电脑', 8], ['电视', 6], ['冰箱', 8],['空调', 8],['洗衣机', 8]], 
'202308': [['电脑', 9], ['电视', 1], ['冰箱', 8],['空调', 8],['洗衣机', 9]], 
'202309': [['电脑', 10], ['电视', 5], ['冰箱', 7],['空调', 7],['洗衣机', 8]], 
'202310': [['电脑', 11], ['电视', 4], ['冰箱', 8],['空调', 8],['洗衣机', 4]], 
'202311': [['电脑', 12], ['电视', 3], ['冰箱', 18],['空调', 8],['洗衣机', 8]], 
'202312': [['电脑', 13], ['电视', 2], ['冰箱', 8],['空调', 8],['洗衣机', 3]]
}
tl_001 = Timeline(init_opts=opts.InitOpts(width="640px", height="400px", theme=ThemeType.LIGHT))           
for date, data in dict.items():
    pie = (
        Pie()
            .add(
            "数量",
            data,
            rosetype="radius",
            radius=["30%", "55%"],
        )
            .set_global_opts(
            legend_opts=opts.LegendOpts(is_show=False),
            visualmap_opts=opts.VisualMapOpts(max_=10, item_width=15, item_height=80),
            title_opts=opts.TitleOpts("每月家电销售情况 (时间: {}月 )".format(date)),

        )
    )
    tl_001.add(pie, "{}".format(date))    
           
tl_001.render_notebook()

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/460908.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Linux:kubernetes(k8s)有状态的服务部署(14)

之前我都是对无状态进行的一个操作,我们想扩容就扩容,想缩容就缩容,根本不用去考虑他的一个网络环境,本地储存环境啥的一个状态 当我们做有状态的服务的操作,肯定要申请一个持久化的一个空间,以及网络&…

tcp/ip协议2实现的插图,数据结构8 (30 - 32章)

(201) 201 三十0 中断优先级补充 (202) 202 三十1 TCP的用户需求 函tcp_usrreq一 (203) 203 三十2 TCP的用户需求 函tcp_usrreq二 (204) 204 三十3 TCP的用户需求 函tcp_usrreq三 (205) 205 三十4 TCP的用户需求 函tcp_usrreq四 (206) 206 三十5 TCP的用户需求 函tcp_usrreq五 …

邮件协议(SMTP、POP3、IMAP4)

电子邮件系统 1、概述 (1)网络电子邮件系统,好处在于价格低廉,速度非常快 (2)形式多样化(文字、图像、声音……) 2、电子邮件系统组成部分 用户代理 MUA(Mail User …

【调参】如何为神经网络选择最合适的学习率lr-LRFinder-for-Keras

【调参】如何为神经网络选择最合适的学习率lr-LRFinder-for-Keras_学习率选择-CSDN博客文章浏览阅读9.2k次,点赞6次,收藏55次。keras 版本的LRFinder,借鉴 fast.ai Deep Learning course。前言学习率lr在神经网络中是最难调的全局参数&#x…

java抽象类的作用及解析

在 Java 中,抽象类是一种特殊的类,它可以用于定义一些抽象的方法和属性,这些方法和属性可能在子类中有不同的实现。 抽象类的主要作用包括: 提供抽象方法:抽象类可以包含一些没有具体实现的抽象方法,这些…

德人合科技 | 公司办公终端、电脑文件资料 \ 数据透明加密防泄密管理软件系统

天锐绿盾是一款全面的企业级数据安全解决方案,它专注于为企业办公终端、电脑文件资料提供数据透明加密防泄密管理。 首页 德人合科技——www.drhchina.com 这款软件系统的主要功能特点包括: 1. **透明加密技术**: 天锐绿盾采用了透明加密技…

〔理论与代码分析〕Fast-SCNN:Fast Semantic Segmentation Network(语义分割、经典网络、速度、高效、实时)

论文地址:Fast-SCNN: Fast Semantic Segmentation Network论文提出时间:2019 年 2 月 12 日官方代码:作者并没有放出源代码,因此下面是一些第三方的实现 PaddleSeg 复现代码:百度飞桨团队复现的代码MMSegmentation 复现…

Spring Boot+Vue前后端分离项目如何部署到服务器

🌟 前言 欢迎来到我的技术小宇宙!🌌 这里不仅是我记录技术点滴的后花园,也是我分享学习心得和项目经验的乐园。📚 无论你是技术小白还是资深大牛,这里总有一些内容能触动你的好奇心。🔍 &#x…

jeesite列表jqGrid表格底部汇总,基于onSelectRow和onSelectAll实现选中行汇总合计

一、最终效果图 二、表格启用复选框并初始化赋值 onSelectAll: function() { calc_sum(); }, onSelectRow: function() { calc_sum(); },// 加载成功后执行事件 ajaxSuccess: function(data){var dy 0;var glbzqmrsdtyg 0;var glbzqmrsschyg 0;var glbzqmrsqtcy 0;…

鸿蒙-自定义组件的生命周期

目录 自定义组件的生命周期 1.aboutToAppear 2.aboutToDisappear 3.onPageShow 4.onPageHide 5.onBackPress 日志输出 1.显示页面 2.页面点击返回按钮 3.页面跳转 4.页面返回 自定义组件的生命周期 先来一段列子 import router from ohos.router Entry Component…

IO Watch:用 Arduino UNO 制造的可编程手表

MAKER:mblaz/译:趣无尽 Cherry(转载请注明出处) 关于手表的项目,之前我们已经介绍过一款《Arduino + 3D 打印 DIY 电子手表》。本期的项目同样的一款基于 Arduino UNO 的可编程的手表,相比之下制造门槛更高一些。同时它更成熟、实用,外形也很有设计感,非常的漂亮! 这…

Linux系列

安装系列 1.MySQL安装 我们要通过rpm,进行MySQL数据库的安装,主要的步骤如下: rpm -qa 查询当前系统中安装的所有软件 rpm -qa | grep mysql 查询当前系统中安装的名称带mysql的软件 rpm -…

YOLOv9(3):YOLOv9损失(Loss)计算

1. 写在前面 YOLOv9的Loss计算与YOLOv8如出一辙,仅存在略微的差异。多说一句,数据的预处理和导入方式都是一样的。因此如果你已经对YOLOv8了解的比较透彻,那么对于YOLOv9你也只是需要多关注网络结构就可以。 YOLOv9本身也是Anchor-Free的&a…

密码CTF

一、[SWPUCTF 2021 新生赛]crypto8——unencode编码 1.题目 73E-30U1&>V-H965S95]I<U]P;WE<GT 特征&#xff1a;有-&#xff0c;是uuencode编码&#xff0c;使用python脚本或者在线网站 二、[AFCTF 2018]Vigenre——维吉尼亚密码 1.题目&#xff1a; 给了一个…

vue使用elementPlus ui框架,如何给Dialog 对话框添加Loading 自定义类名显示隐藏

vue使用elementPlus ui框架时&#xff0c;如何给Dialog 对话框添加Loading 自定义类名&#xff0c;想要实现dialog对话框区域有loading效果 官方给出的这个API配置项customClass&#xff0c;使用不太明确。暂时无法实现绑定class。 最后的实现方式&#xff1a; <template&…

产品之美8| 壁纸中的图案随着用户行为变化

上一篇写了壁纸中的图案随着时间和季节变化&#xff0c;留下一个问题&#xff0c;如果壁纸随用户行为该怎样变化&#xff1f; 这一篇就是折叠手机中的壁纸&#xff0c;其中图案随着用户打开手机而动态变化。具体见图&#xff1a; 随着折叠手机的打开&#xff0c;壁纸中的小鱼进…

深度强化学习01

Random variable Probability Density Function 学习视频 这绝对是我看过最好的深度强化学习&#xff01;从入门到实战&#xff0c;7小时内干货不断&#xff01;_哔哩哔哩_bilibili

Java多线程实战-基于注解和AOP切面的异步操作日志记录解决方案

&#x1f3f7;️个人主页&#xff1a;牵着猫散步的鼠鼠 &#x1f3f7;️系列专栏&#xff1a;Java全栈-专栏 &#x1f3f7;️本系列源码仓库&#xff1a;多线程并发编程学习的多个代码片段(github) &#x1f3f7;️个人学习笔记&#xff0c;若有缺误&#xff0c;欢迎评论区指正…

K8S日志收集方案-EFK部署

EFK架构工作流程 部署说明 ECK (Elastic Cloud on Kubernetes)&#xff1a;2.7 Kubernetes&#xff1a;1.23.0 文件准备 crds.yaml 下载地址&#xff1a;https://download.elastic.co/downloads/eck/2.7.0/crds.yaml operator.yaml 下载地址&#xff1a;https://download.e…

鸿蒙Harmony应用开发—ArkTS声明式开发(容器组件:FormLink)

提供静态卡片交互组件&#xff0c;用于静态卡片内部和提供方应用间的交互&#xff0c;当前支持router、message和call三种类型的事件。 说明&#xff1a; 该组件从API Version 10开始支持。后续版本如有新增内容&#xff0c;则采用上角标单独标记该内容的起始版本。 该组件仅可…