当前位置: 首页 > news >正文

河南建设厅八大员查询网站wordpress文章标题字数

河南建设厅八大员查询网站,wordpress文章标题字数,做企业展示型网站的好处,个人域名的网站文章目录 一、JSON1.JSON介绍2.JSON格式数据转化3.示例 二、pyecharts1.安装pyecharts包2.查看官方示例 三、开发示例 一、JSON 1.JSON介绍 JSON是一种轻量级的数据交互格式#xff0c;采用完全独立于编程语言的文本格式来存储和表示数据#xff08;就是字符串#xff09;… 文章目录 一、JSON1.JSON介绍2.JSON格式数据转化3.示例 二、pyecharts1.安装pyecharts包2.查看官方示例 三、开发示例 一、JSON 1.JSON介绍 JSON是一种轻量级的数据交互格式采用完全独立于编程语言的文本格式来存储和表示数据就是字符串。 Python语言使用JSON有很大优势因为JSON无非就是一个单独的字典或一个内部元素都是字典的列表。 总结所以JSON可以直接和Python的字典或列表进行无缝转换。 2.JSON格式数据转化 通过 json.dumps(data) 方法把python数据转化为了json数据 data json.dumps(data)如果有中文可以带上:ensure asciiFalse参数来确保中文正常转换 通过 json.loads(data) 方法把json数据转化为了 python列表或字典 data json.loads(data)3.示例 echarts/__init__.pydata.txtjsonData.pydata.txt {code: 10000,msg: null,error: true,data: {total: 1664,items: [{stat_date: 2024-01-09,genome: 1,industrial: 3,literature: 3,patent: 6},{stat_date: 2024-01-08,genome: 3,industrial: 8,literature: 6,patent: 9},{stat_date: 2024-01-07,genome: 3,industrial: 5,literature: 7,patent: 6},{stat_date: 2024-01-06,genome: 5,industrial: 7,literature: 3,patent: 8},{stat_date: 2024-01-05,genome: 9,industrial: 7,literature: 5,patent: 7},{stat_date: 2024-01-04,genome: 3,industrial: 5,literature: 8,patent: 5},{stat_date: 2024-01-03,genome: 8,industrial: 0,literature: 8,patent: 6},{stat_date: 2024-01-02,genome: 0,industrial: 9,literature: 4,patent: 4},{stat_date: 2024-01-01,genome: 7,industrial: 8,literature: 0,patent: 3},{stat_date: 2024-01-10,genome: 3,industrial: 7,literature: 4,patent: 6}],has_more: true} }jsonData.py import jsondef formatData():# 日期列表date_data {}date []# 数据genome_data []industrial_data []literature_data []patent_data []try:with open(D:/test/demo/echarts/data.txt,r,encodingutf-8) as file:for line in file:line line.strip()if len(line.split(:)) 1:continuedata line.split(:)[1].replace(,).strip( ,)if line.startswith(stat_date):date.append(data)elif line.startswith(genome):genome_data.append(data)elif line.startswith(industrial):industrial_data.append(data)elif line.startswith(literature):literature_data.append(data)elif line.startswith(patent):patent_data.append(data)except Exception as e:print(f出现异常啦{e})date_data[date] datedate_json json.dumps(date_data)genome_json json.dumps(genome_data)industrial_json json.dumps(industrial_data)literature_json json.dumps(literature_data)patent_json json.dumps(patent_data)print(f{type(date_json)},{date_json})print(f{type(genome_json)},{genome_json})print(f{type(industrial_json)},{industrial_json})print(f{type(literature_json)},{literature_json})print(f{type(patent_json)},{patent_json})return date_json,genome_json,industrial_json,literature_json,patent_json输出 class str,{date: [2024-01-09, 2024-01-09, 2024-01-09, 2024-01-09, 2024-01-09, 2024-01-09, 2024-01-09, 2024-01-09, 2024-01-09, 2024-01-09]} class str,[1, 3, 3, 5, 9, 3, 8, 0, 7, 3] class str,[3, 8, 5, 7, 7, 5, 0, 9, 8, 7] class str,[3, 6, 7, 3, 5, 8, 8, 4, 0, 4] class str,[6, 9, 6, 8, 7, 5, 6, 4, 3, 6]二、pyecharts 开发可视化图表使用的技术栈是Echarts框架的python版本pyecharts包。 1.安装pyecharts包 通过pip下载pyecharts包在开发过程中直接引用即可。 下载命令如下 pip install pyecharts代码中引用示例 import pyecharts.options as opts from pyecharts.charts import Line2.查看官方示例 pyecharts-gallery可通过官方示例详细学习和使用。 三、开发示例 下面我们就是用上面的JSON和pyecharts进行实践生成一个折线图且带有工具栏。通过浏览器访问html文件可查看统计图。例如 可通过工具栏中下载图片切换柱状图折线图数据等。 代码示例如下 echarts/__init__.pydata.txtjsonData.py# 运行后生成line.htmlline.htmlline.pyjsonData.py代码不变 line.py import jsonimport pyecharts.options as opts from pyecharts.charts import Line import jsonDatadate_json,genome_json,industrial_json,literature_json,patent_json jsonData.formatData() date json.loads(date_json)[date] (Line().add_xaxis(xaxis_datadate).add_yaxis(series_namegenome,y_axisjson.loads(genome_json),symbolemptyCircle,is_symbol_showTrue,label_optsopts.LabelOpts(is_showTrue)).add_yaxis(series_nameindustrial,y_axisjson.loads(industrial_json),symbolemptyCircle,is_symbol_showTrue,label_optsopts.LabelOpts(is_showTrue)).add_yaxis(series_namepatent,y_axisjson.loads(patent_json),symbolemptyCircle,is_symbol_showTrue,label_optsopts.LabelOpts(is_showTrue)).add_yaxis(series_nameliterature,y_axisjson.loads(literature_json),symbolemptyCircle,is_symbol_showTrue,label_optsopts.LabelOpts(is_showTrue)).set_global_opts(title_optsopts.TitleOpts(title数统计, subtitle纯属虚构),tooltip_optsopts.TooltipOpts(triggeraxis),toolbox_optsopts.ToolboxOpts(is_showTrue),xaxis_optsopts.AxisOpts(type_category),yaxis_optsopts.AxisOpts(type_value,splitline_optsopts.SplitLineOpts(is_showTrue),)).render(D:/test/demo/echarts/line.html) ) 运行line.py之后生成line.html文件直接浏览器打开可以看到如图
http://www.hkea.cn/news/14471396/

相关文章:

  • 网站开发的条件公司网站建设价格
  • 网站终端制作搜索排名提升
  • 服务器与网站c 在线视频网站开发
  • 只用js可以做网站吗网创是什么
  • 重庆seo网站哪家好做展示网站要恋用什么程序
  • 峡山网站建设wordpress keyword
  • 做电影网站需多大的空间dux2.0支持Wordpress
  • 江门市网站建设 熊掌号关于建设企业网站的请示
  • 分级会员管理系统网站开发wordpress调用文章内容图片
  • 保定手机网站让wordpress自检
  • 网站建设翻译插件安安互联怎么上传网站
  • 做cpa用什么类型的网站好网页推广方案
  • 做现金贷的网站有哪些饿了吗外卖网站怎么做
  • 物流如何做网站装修效果图素材网
  • 做网站ftp网站建设从哪入手
  • 在线捐款网站开发网站效果图设计方案
  • 自助建站平台源码wordpress纯代码屏蔽谷歌字体
  • 设计网站接单wordpress漫画小说
  • 怎样建手机网站深圳营销策划公司
  • 网站制作费一般多少不同网站相似的页面百度不收录吗
  • 哪里有做网站的公司专门做民宿的网站
  • 直播是网站怎么做网站费用构成
  • 制作网站的最新软件是什么查找人网站 优帮云
  • 学校门户网站建设工作做网站找个人还是公司
  • 唐河网站制作打开百度首页
  • 网站logo素材互联网排名前100的公司
  • 西宁网站建设最好的公司北京市公共资源交易服务平台
  • 做网站资源管理是高校网站模板
  • wordpress多站点批量添加wordpress不用主题
  • 龙岩网站建惠州市网站开发