Python综合练习之图表

这篇具有很好参考价值的文章主要介绍了Python综合练习之图表。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。


Python学习了约一个月的时间,这是一篇综合练习的文章。主要做的内容是通过封装对象、实现抽象方法生成统计图、数据表格的功能。

文件目录如下

articles/
	__init__.py
	articles.json
	articlesData.py
	articlesEchartsEntity.py
	articlesEntity.py
	table_base.html
	timeline_bar_with_graphic.html

图标效果

timeline_bar_with_graphic.html

Python综合练习之图表,python,python,开发语言

table_base.html

Python综合练习之图表,python,python,开发语言

articles.json

是我的csdn文章的标题、得分、阅读量的数据

[
    {
        "title": "实战之简单OOM",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134413400",
        "viewCount": 14,
        "score": 21
    },
    {
        "title": "使用jenkins持续集成springboot项目(四、nginx域名映射)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/132979875",
        "viewCount": 47,
        "score": 24
    },
    {
        "title": "数据库存储引擎",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131707806",
        "viewCount": 20,
        "score": 24
    },
    {
        "title": "后端开发面试题",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131955660",
        "viewCount": 318,
        "score": 26
    },
    {
        "title": "Mysql锁",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131723792",
        "viewCount": 25,
        "score": 29
    },
    {
        "title": "HashMap详解",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131554332",
        "viewCount": 34,
        "score": 29
    },
    {
        "title": "Java多线程之线程状态",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131795708",
        "viewCount": 29,
        "score": 34
    },
    {
        "title": "Java多线程之interrupt",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134310943",
        "viewCount": 15,
        "score": 39
    },
    {
        "title": "SpringBoot集成ElasticSearch(依赖不同,业务代码与JPA方式也不同)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/133940678",
        "viewCount": 44,
        "score": 41
    },
    {
        "title": "blast安装及简单使用",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135109803",
        "viewCount": 497,
        "score": 44
    },
    {
        "title": "Python基础(三、探索布尔型、if-else语句、while循环和continue语句)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134884680",
        "viewCount": 178,
        "score": 46
    },
    {
        "title": "Mysql执行计划",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131709675",
        "viewCount": 22,
        "score": 47
    },
    {
        "title": "Mysql隔离级别",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131697649",
        "viewCount": 34,
        "score": 47
    },
    {
        "title": "Python基础(四、探索迷宫游戏)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134906292",
        "viewCount": 391,
        "score": 51
    },
    {
        "title": "使用jenkins持续集成springboot项目(二、Jenkins任务配置)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/132977536",
        "viewCount": 50,
        "score": 51
    },
    {
        "title": "使用jenkins持续集成springboot项目(三、上服务器)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/132978301",
        "viewCount": 20,
        "score": 52
    },
    {
        "title": "Python基础( 七、休闲大富翁游戏)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135000098",
        "viewCount": 589,
        "score": 54
    },
    {
        "title": "docker学习(四、修改容器创建新的镜像推送到云上)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134777644",
        "viewCount": 109,
        "score": 54
    },
    {
        "title": "docker学习(十七、Dockerfile之NodeJs示例)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135151286",
        "viewCount": 338,
        "score": 56
    },
    {
        "title": "docker学习(八、mysql8.2主从复制遇到的问题)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134871764",
        "viewCount": 983,
        "score": 56
    },
    {
        "title": "Springboot集成ElasticSearch+JPA",
        "url": "https://blog.csdn.net/qq_35716085/article/details/133878232",
        "viewCount": 43,
        "score": 56
    },
    {
        "title": "Python基础(九、重要的全局变量)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135194814",
        "viewCount": 401,
        "score": 57
    },
    {
        "title": "logstash同步mysql数据到es(一、es模板问题,请求返回400)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134944124",
        "viewCount": 321,
        "score": 57
    },
    {
        "title": "Python基础(十三、序列)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135344702",
        "viewCount": 249,
        "score": 61
    },
    {
        "title": "docker学习(十六、Dockerfile之Java示例)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135151045",
        "viewCount": 373,
        "score": 61
    },
    {
        "title": "Python基础(缩进:让代码更美观、更清晰)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134993750",
        "viewCount": 10,
        "score": 62
    },
    {
        "title": "服务启动时报错failed: Connection refused: connect",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135057342",
        "viewCount": 425,
        "score": 64
    },
    {
        "title": "docker学习(十五、Dockerfile之python示例)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135150935",
        "viewCount": 537,
        "score": 65
    },
    {
        "title": "docker学习(三、常用命令,超实用)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134711071",
        "viewCount": 286,
        "score": 65
    },
    {
        "title": "使用jenkins持续集成springboot项目(一、项目打包坑集)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/132974806",
        "viewCount": 58,
        "score": 65
    },
    {
        "title": "Java多线程之sleep、yield、join",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131787451",
        "viewCount": 98,
        "score": 65
    },
    {
        "title": "docker重量级容器预警监控系统CIG",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135289219",
        "viewCount": 405,
        "score": 69
    },
    {
        "title": "Python基础(十一、数据容器之元组Tuple)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135222876",
        "viewCount": 474,
        "score": 71
    },
    {
        "title": "docker学习(十、搭建redis集群,三主三从)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135113131",
        "viewCount": 503,
        "score": 71
    },
    {
        "title": "docker学习(二十、network使用示例host、none)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135215618",
        "viewCount": 658,
        "score": 72
    },
    {
        "title": "docker学习(十二、Redis主从容错迁移)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135124607",
        "viewCount": 583,
        "score": 72
    },
    {
        "title": "docker学习(六、容器卷)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134825570",
        "viewCount": 440,
        "score": 72
    },
    {
        "title": "springboot跨域问题,解决方法",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135108526",
        "viewCount": 385,
        "score": 75
    },
    {
        "title": "Python基础(八、random模块探秘)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135022724",
        "viewCount": 431,
        "score": 76
    },
    {
        "title": "Dify.ai 10分钟带你体验Embedding对话应用",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134809112",
        "viewCount": 919,
        "score": 79
    },
    {
        "title": "Mysql优化",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131720803",
        "viewCount": 22,
        "score": 79
    },
    {
        "title": "docker学习(十一、Redis集群存储数据方式)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135114324",
        "viewCount": 535,
        "score": 80
    },
    {
        "title": "轻松学会Elasticsearch+kibana",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134976541",
        "viewCount": 175,
        "score": 80
    },
    {
        "title": "Java多线程之并发特性",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131761923",
        "viewCount": 31,
        "score": 80
    },
    {
        "title": "Python基础(十五、数据容器之字典Dict)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135275642",
        "viewCount": 142,
        "score": 81
    },
    {
        "title": "docker-compose启动项目时报错Version in “./docker-compose.yml“ is unsupported.",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135065241",
        "viewCount": 378,
        "score": 81
    },
    {
        "title": "logstash同步mysql数据到es(二、jdbc_driver_library问题)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134944439",
        "viewCount": 303,
        "score": 81
    },
    {
        "title": "Python基础(一、安装环境及入门)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134877749",
        "viewCount": 307,
        "score": 82
    },
    {
        "title": "SpringBoot集成Eureka",
        "url": "https://blog.csdn.net/qq_35716085/article/details/133941164",
        "viewCount": 87,
        "score": 82
    },
    {
        "title": "docker学习(一、docker与VM对比)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134732935",
        "viewCount": 340,
        "score": 83
    },
    {
        "title": "Python基础(十四、数据容器之集合Set)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135222946",
        "viewCount": 473,
        "score": 84
    },
    {
        "title": "docker学习(二十一、network使用示例container、自定义)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135218009",
        "viewCount": 990,
        "score": 84
    },
    {
        "title": "docker学习(十九、network使用示例bridge)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135197980",
        "viewCount": 718,
        "score": 84
    },
    {
        "title": "Mysql事务",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131681556",
        "viewCount": 54,
        "score": 84
    },
    {
        "title": "nginx 一、安装与conf浅析",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135337375",
        "viewCount": 250,
        "score": 85
    },
    {
        "title": "docker学习(五、部署本地私有仓库)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134800765",
        "viewCount": 928,
        "score": 85
    },
    {
        "title": "服务启动时报错Communications link failure",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135057149",
        "viewCount": 213,
        "score": 86
    },
    {
        "title": "实战之shardingjdbc引入报错Cannot invoke “Object.toString()“ because the return value of “java.util.Map.get(",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134790326",
        "viewCount": 745,
        "score": 88
    },
    {
        "title": "docker学习(二、安装docker)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134733341",
        "viewCount": 730,
        "score": 88
    },
    {
        "title": "docker学习——汇总版",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135293661",
        "viewCount": 731,
        "score": 89
    },
    {
        "title": "docker学习(十四、Dockerfile基础)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135131649",
        "viewCount": 947,
        "score": 89
    },
    {
        "title": "docker学习(十三、Redis主从扩容、缩容)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135125327",
        "viewCount": 2112,
        "score": 89
    },
    {
        "title": "logstash同步mysql数据到es(三、es模板问题)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134945940",
        "viewCount": 98,
        "score": 89
    },
    {
        "title": "springboot+shardingjdbc(只分表、不分库)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134788951",
        "viewCount": 436,
        "score": 89
    },
    {
        "title": "Redis设计与实现(阅读笔记、二)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134670760",
        "viewCount": 341,
        "score": 89
    },
    {
        "title": "Redis设计与实现(阅读笔记、一)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134312572",
        "viewCount": 312,
        "score": 89
    },
    {
        "title": "docker轻量级可视化工具Portainer",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135268224",
        "viewCount": 874,
        "score": 90
    },
    {
        "title": "Python基础(十、数据容器之列表List)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135220636",
        "viewCount": 919,
        "score": 90
    },
    {
        "title": "Mysql索引",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131657505",
        "viewCount": 75,
        "score": 90
    },
    {
        "title": "Python基础(十二、数据容器之字符串)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135222922",
        "viewCount": 1605,
        "score": 91
    },
    {
        "title": "Python基础(五、掌握for循环、range、break和continue用法,猜数游戏)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134993056",
        "viewCount": 243,
        "score": 91
    },
    {
        "title": "Python基础(八、函数的妙用,猫捉老鼠游戏)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135158407",
        "viewCount": 842,
        "score": 92
    },
    {
        "title": "使用docker实现logstash同步mysql到es",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134946153",
        "viewCount": 377,
        "score": 92
    },
    {
        "title": "Python基础(二、必备知识,不用背,用用就会了~)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134883841",
        "viewCount": 427,
        "score": 92
    },
    {
        "title": "docker学习(七、搭建mysql8.2主从)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134854670",
        "viewCount": 1093,
        "score": 92
    },
    {
        "title": "docker学习(二十二、终篇,docker-compose)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135263672",
        "viewCount": 973,
        "score": 93
    },
    {
        "title": "docker学习(九、分布式存储亿级数据知识)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135011956",
        "viewCount": 974,
        "score": 93
    },
    {
        "title": "Java多线程之volatile",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131806551",
        "viewCount": 91,
        "score": 93
    },
    {
        "title": "Python基础(六、掌握if、while用法)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/134994680",
        "viewCount": 27,
        "score": 94
    },
    {
        "title": "Spring IOC 实现原理",
        "url": "https://blog.csdn.net/qq_35716085/article/details/132427790",
        "viewCount": 45,
        "score": 94
    },
    {
        "title": "docker学习(十八、network介绍)",
        "url": "https://blog.csdn.net/qq_35716085/article/details/135196020",
        "viewCount": 1194,
        "score": 95
    },
    {
        "title": "Java多线程之synchronized",
        "url": "https://blog.csdn.net/qq_35716085/article/details/131825116",
        "viewCount": 456,
        "score": 95
    }
]

articlesData.py

这个模块相当于我要对外开放的接口汇总,其中包含了:

  • init:构造函数
  • time_bar:生成统计图的对外接口,最后会给返回统计图的位置,浏览器打开html即可看到统计图
  • table_file:生成表格的对外接口,最后会给返回表格的位置,浏览器打开html即可看到表格
  • __read_file:读取json文件的私有方法
  • __format_file_data:解析json文件数据,提供给表格用
  • __format_time_bar_data:解析json文件数据,提供给统计图用
import json

import articlesEntity
from articles import articlesEchartsEntity


class OpenFile:

    def __init__(self, path):
        self.path = path

    # 获取数据中标题、数量、分数
    def time_bar(self):
        if None == self.path:
            return "路径不能为空"
        json_data = self.__read_file()
        data_list, title_list, count_dict, score_dict = self.__format_time_bar_data(json_data)
        path = articlesEchartsEntity.ArticlesEcharts().time_bar(title_list, count_dict, score_dict)
        return print(f"已生成<a href='{path}'>超全功能统计图</a>")

    # 解析文件,获取数据
    def table_file(self):
        if None == self.path:
            return "路径不能为空"
        json_data = self.__read_file()
        data_list = self.__format_file_data(json_data)
        path = articlesEntity.Articles().articles_table(data_list)
        return print(f"已生成<a href='{path}'>表格</a>")

    # 读取文件
    def __read_file(self):
        with open(self.path, "r") as file:
            json_data: list = json.loads(file.read())
        return json_data

    # 解析全部数据
    def __format_file_data(self, json_data):
        data_list = []
        for data in json_data:
            articles = articlesEntity.Articles(data["title"], data["url"], data["viewCount"],
                                               data["score"])
            data_list.append(articles)
        return data_list

    # 解析折线图数据
    def __format_time_bar_data(self, json_data):
        data_list = []
        title_list = []
        count_dict = {}
        score_dict = {}
        count_list = []
        score_list = []
        # 计数器
        count = 1
        # 月份
        month = 0
        for data in json_data:
            articlesEcharts = articlesEchartsEntity.ArticlesEcharts(data["title"], data["viewCount"],
                                                                    data["score"])
            data_list.append(articlesEcharts)
            title_list.append(data["title"])
            if count <= 8:
                count_list.append(data["viewCount"])
                score_list.append(data["score"])
                count += 1
            else:
                month += 1
                count_dict[month] = count_list
                score_dict[month] = score_list
                count_list = []
                score_list = []
                count = 1

        return data_list, title_list[:8], count_dict, score_dict


if __name__ == "__main__":
    openFile = OpenFile("D:/test/demo/articles/articles.json")
    print(openFile.table_file())
    print(openFile.time_bar())

articlesEchartsEntity.py

在这个文件中封装了articlesEchartsEntity对象,包含:

  • EchartsData:抽象类,用于写支持的统计图
    • time_bar:支持时间柱状图
  • ArticlesEcharts:实现抽象类
    • init:构造函数
    • time_bar:实现抽象方法,生成统计图
from articles.articlesEntity import Articles
from pyecharts import options as opts
from pyecharts.charts import Bar, Timeline
from pyecharts.commons.utils import JsCode
from abc import ABC, abstractmethod


class EchartsData(ABC):

    @abstractmethod
    def time_bar(self, *args):
        pass


class ArticlesEcharts(Articles, EchartsData):
    def __init__(self, title=None, viewCount=None, score=None):
        super().__init__(title, viewCount, score)
        if title is not None:
            self.title = title
        if viewCount is not None:
            self.viewCount = viewCount
        if score is not None:
            self.score = score

    def time_bar(self, x, score_y, count_y):
        tl = Timeline()
        for i in range(1, 10):
            bar = (
                Bar()
                .add_xaxis(x)
                .add_yaxis("阅读量", count_y[i])
                .add_yaxis("分数", score_y[i])
                .set_global_opts(
                    title_opts=opts.TitleOpts("文章2023年 - With Graphic 组件"),
                    graphic_opts=[
                        opts.GraphicGroup(
                            graphic_item=opts.GraphicItem(
                                rotation=JsCode("Math.PI / 4"),
                                bounding="raw",
                                right=100,
                                bottom=110,
                                z=100,
                            ),
                            children=[
                                opts.GraphicRect(
                                    graphic_item=opts.GraphicItem(
                                        left="center", top="center", z=100
                                    ),
                                    graphic_shape_opts=opts.GraphicShapeOpts(
                                        width=400, height=50
                                    ),
                                    graphic_basicstyle_opts=opts.GraphicBasicStyleOpts(
                                        fill="rgba(0,0,0,0.3)"
                                    ),
                                ),
                                opts.GraphicText(
                                    graphic_item=opts.GraphicItem(
                                        left="center", top="center", z=100
                                    ),
                                    graphic_textstyle_opts=opts.GraphicTextStyleOpts(
                                        text="文章{}月".format(i),
                                        font="bold 26px Microsoft YaHei",
                                        graphic_basicstyle_opts=opts.GraphicBasicStyleOpts(
                                            fill="#fff"
                                        ),
                                    ),
                                ),
                            ],
                        )
                    ],
                )
            )
            tl.add(bar, "{}月".format(i))
        path = "D:/test/demo/articles/timeline_bar_with_graphic.html"
        tl.render(path)
        return path

articlesEntity.py

这是文章对象,其中包含的函数:文章来源地址https://www.toymoban.com/news/detail-803338.html

  • init:构造函数
  • str:魔法函数,输出字符串
  • articles_table:生成表格的方法
  • __format_list:格式化数据,提供给表格用,私有方法
from pyecharts.components import Table
from pyecharts.options import ComponentTitleOpts

class Articles:
    def __init__(self, title=None, url=None, viewCount=None, score=None):
        if title is not None:
            self.title = title
        if url is not None:
            self.url = url
        if viewCount is not None:
            self.viewCount = viewCount
        if score is not None:
            self.score = score

    def __str__(self):
        print(f"<a href='{self.url}'>{self.title}</a>可通过链接查看详细内容~")

    def articles_table(self, data_list):
        header_list = ["标题", "统计分数", "统计阅读数","地址"]
        table = Table()
        rows_list_list = self.__format_list(data_list)
        table.add(header_list, rows_list_list)
        table.set_global_opts(
            title_opts=ComponentTitleOpts(title="Table-文章数据统计")
        )
        path = "D:/test/demo/articles/table_base.html"
        table.render("table_base.html")
        return path

    def __format_list(self, data_list):
        rows_list_list = []
        for articles in data_list:
            rows_list = []
            rows_list.append(articles.title)
            rows_list.append(articles.score)
            rows_list.append(articles.viewCount)
            rows_list.append(articles.url)
            rows_list_list.append(rows_list)
        return rows_list_list

到了这里,关于Python综合练习之图表的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Python 绘制数据图表

    matplotlib绘图库模块安装 导入pyplot子模块 官网:http://matplotlib.org 官方文档:https://matplotlib.org/stable/index.html 1.1 绘制简单的折线图 效果: 1.2 修改图表的初始值 效果: 1.3 多组数据的应用 效果: 1.4 设置线条颜色及样式 设置颜色,可在plot()中添加参数: ‘b’: blue ‘c’: cyan

    2024年02月05日
    浏览(29)
  • 【小沐学Python】Python实现Web图表功能(Dash)

    https://dash.plotly.com/ https://dash.gallery/Portal/ Dash 是一个用于构建Web应用程序的 Python 库,无需 JavaScript 。 Dash是下载量最大,最值得信赖的Python框架,用于构建ML和数据科学Web应用程序。 Dash是一个用来创建 web 应用的 python 库,它建立在 Plotly.js(同一个团队开发)、React 和 Flask 之上

    2024年02月04日
    浏览(41)
  • 如何使用 Python 通过代码创建图表

    简介 Diagram as Code 工具允许您创建基础架构的架构图。您可以重复使用代码、测试、集成和自动化绘制图表的过程,这将使您能够将文档视为代码,并构建用于映射基础架构的流水线。您可以使用 diagrams 脚本与许多云提供商和自定义基础架构。 在本教程中,您将使用 Python 创

    2024年02月20日
    浏览(34)
  • 【开发语言】C语言与Python的互操作详解

    博主未授权任何人或组织机构转载博主任何原创文章,感谢各位对原创的支持! 博主链接 本人就职于国际知名终端厂商,负责modem芯片研发。 在5G早期负责终端数据业务层、核心网相关的开发工作,目前牵头6G算力网络技术标准研究。 博客内容主要围绕:        5G/6G协议

    2024年02月10日
    浏览(38)
  • 入门Python编程:了解计算机语言、Python介绍和开发环境搭建

    计算机语言是用来控制计算机行为的一种语言,通过它可以告诉计算机该做什么。计算机语言和人类语言在本质上没有太大区别,只是交流的对象不同。 计算机语言发展经历了三个阶段: 1. 机器语言 机器语言使用二进制编码来编写程序。 执行效率高,但编写起来麻烦。 2

    2024年02月09日
    浏览(44)
  • 【Python入门系列】第十五篇:Python数据可视化和图表绘制

    数据可视化是数据分析和数据科学中非常重要的一部分。通过可视化,我们可以更好地理解数据、发现数据之间的关系、展示数据的趋势和模式,并向他人传达我们的发现。 Python是一种功能强大的编程语言,拥有许多用于数据可视化的库和工具。其中,Matplotlib是最常用的绘

    2024年02月13日
    浏览(26)
  • Python大数据之PySpark(三)使用Python语言开发Spark程序代码

    Spark Standalone的PySpark的搭建----bin/pyspark --master spark://node1:7077 Spark StandaloneHA的搭建—Master的单点故障(node1,node2),zk的leader选举机制,1-2min还原 【scala版本的交互式界面】bin/spark-shell --master xxx 【python版本交互式界面】bin/pyspark --master xxx 【提交任务】bin/spark-submit --master xxxx 【学

    2024年01月17日
    浏览(39)
  • Python中使用matplotlib绘制各类图表示例

    折线图 折线图是一种用于表示数据随时间、变量或其他连续性变化的趋势的图表。通过在横轴上放置时间或如此类似的连续变量,可以在纵轴上放置数据点的值,从而捕捉到数据随时间发生的变化。折线图可以用于比较不同变量的趋势,轻松地发现不同的变量之间的差异。

    2024年02月10日
    浏览(31)
  • Python读取csv、Excel文件生成图表

    简介 本文章介绍了通过读取 csv 或 Excel 文件内容,将其转换为折线图或柱状图的方法,并写入 html 文件中。 目录 1. 读取CSV文件 1.1. 生成折线图 1.1.1. 简单生成图表 1.1.2. 设置折线图格式 1.2. 生成柱状图 1.2.1. 简单生成图表 1.2.2. 设置柱状图格式 2. 读取Excel文件 2.1. 生成折线图

    2024年02月15日
    浏览(39)
  • 自动化理论基础(2)—开发语言之Python

    一、知识汇总 掌握 Python 编程语言需要具备一定的基础知识和技能,特别是对于从事自动化测试等领域的工程师。以下是掌握 Python 的一些关键方面: 基本语法: 理解 Python 的基本语法,包括变量、数据类型、运算符、条件语句、循环语句等。 数据结构: 熟悉并能够使用

    2024年01月18日
    浏览(50)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包