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

湘潭做网站选择磐石网络网站seo哪家公司好

湘潭做网站选择磐石网络,网站seo哪家公司好,移动端网站和微信网页设计,网页设计跟做网站一样吗数据来源 https://archive.ics.uci.edu/dataset/2/adult 过程 首先;关于教育背景的部分翻译有问题。 本次使用字典嵌套记录数据,并且通过lambda在sorted内部进行对某个字典的排序,最后用plotly进行绘图 本次提取数据的时候,用到…

数据来源

https://archive.ics.uci.edu/dataset/2/adult

过程

首先;关于教育背景的部分翻译有问题。
本次使用字典嵌套记录数据,并且通过lambda在sorted内部进行对某个字典的排序,最后用plotly进行绘图
本次提取数据的时候,用到了array的布尔型数组,这是比较方便的一种做法

import numpy as np
import matplotlib.pyplot as plt
from plotly.graph_objs import Bar,Layout
from plotly import offlinefilename='/Users/oommnn/Desktop/学习笔记/数据可视化30天项目/adult.csv'
change_educations=['学士','大专','11年级','研究生','教授','副学士','副学士','9年级','7 -8年级','12年级','硕士','1 -4年级','10年级','博士','5 -6年级','学前']
educations=[' Bachelors', ' Some-college', ' 11th', ' HS-grad', ' Prof-school',' Assoc-acdm', ' Assoc-voc', ' 9th', ' 7th-8th', ' 12th', ' Masters', ' 1st-4th', ' 10th', ' Doctorate', ' 5th-6th', ' Preschool']#生成结果字典
results={}
for education in change_educations:results[education]={'sum':0,'sum_over_50k':0,'ratio':0.0}user_info=np.dtype([('education','U20'),('income','U10')])
data=np.loadtxt(filename,delimiter=',',dtype=user_info,usecols=(3,14))#替换数据
i=0
for education in educations:flag=(data['education']==education)data['education'][flag]=change_educations[i]i=i+1#获得总数和超过50k的数据
for education in change_educations:isedu=data['education']==education#记录每个学位的总人数results[education]['sum']=len(data['education'][isedu])#获得超过50k的该学位的布尔数组isrel=data[isedu]['income']==' >50K'results[education]['sum_over_50k']=len(data[isedu][isrel])results[education]['ratio']=results[education]['sum_over_50k']/results[education]['sum']#key=lambda item: item[1] 是Python中用于排序或过滤列表的一个常见表达式。
#这里的 lambda 创建了一个匿名函数,它接受一个参数 item(假设是一个元组或其他可迭代对象),然后返回 item 的第二个元素,即 item[1]。
#返回的是列表的元组;按照item进行排序
sorted_items_by_values = sorted(results.items(), key=lambda item: item[1]['ratio'],reverse=True)
sorted_dict_by_values = dict(sorted_items_by_values)
#print(sorted_items_by_values)#获得x,y和hovertext的值
x_values=list(sorted_dict_by_values.keys())
y_values=list(sorted_dict_by_values[key]['ratio'] for key in sorted_dict_by_values.keys())
hovertext_values=list(f"总数:{sorted_dict_by_values[key]['sum']}" for key in sorted_dict_by_values.keys())#可视化;并且鼠标显示总人数标签
data=[{'type':'bar','x':x_values,'y':y_values,'hovertext':hovertext_values
}]mylayout={'title':'教育背景与收入超过50k统计','xaxis':{'title':'教育背景',},'yaxis':{'title':'超过50k的人数/总人数'}}
fig={'data':data,'layout':mylayout}
offline.plot(fig,filename='adult.html')

在这里插入图片描述


文章转载自:
http://chock.rdgb.cn
http://fso.rdgb.cn
http://constantinople.rdgb.cn
http://electrostatics.rdgb.cn
http://gemmaceous.rdgb.cn
http://pastiche.rdgb.cn
http://antepartum.rdgb.cn
http://guiro.rdgb.cn
http://naziism.rdgb.cn
http://orchestrina.rdgb.cn
http://carload.rdgb.cn
http://methoxamine.rdgb.cn
http://protophloem.rdgb.cn
http://cockshot.rdgb.cn
http://tide.rdgb.cn
http://hunk.rdgb.cn
http://rah.rdgb.cn
http://barbellate.rdgb.cn
http://pteryla.rdgb.cn
http://filthify.rdgb.cn
http://stripe.rdgb.cn
http://antimacassar.rdgb.cn
http://trapball.rdgb.cn
http://sty.rdgb.cn
http://saugh.rdgb.cn
http://instil.rdgb.cn
http://agog.rdgb.cn
http://housemistress.rdgb.cn
http://nautophone.rdgb.cn
http://contracyclical.rdgb.cn
http://cycloparaffin.rdgb.cn
http://upsoar.rdgb.cn
http://tessellation.rdgb.cn
http://nubia.rdgb.cn
http://nuque.rdgb.cn
http://turbaned.rdgb.cn
http://eucharistic.rdgb.cn
http://jerboa.rdgb.cn
http://culpability.rdgb.cn
http://macilent.rdgb.cn
http://mugient.rdgb.cn
http://replicate.rdgb.cn
http://seafowl.rdgb.cn
http://compuserve.rdgb.cn
http://vermilion.rdgb.cn
http://awkwardly.rdgb.cn
http://filch.rdgb.cn
http://casuistics.rdgb.cn
http://snap.rdgb.cn
http://panasonic.rdgb.cn
http://lymphoblastic.rdgb.cn
http://puttyblower.rdgb.cn
http://esv.rdgb.cn
http://prioress.rdgb.cn
http://scalloppine.rdgb.cn
http://prefectorial.rdgb.cn
http://gynoecia.rdgb.cn
http://condign.rdgb.cn
http://aerology.rdgb.cn
http://flinthead.rdgb.cn
http://drugola.rdgb.cn
http://provocable.rdgb.cn
http://peribolos.rdgb.cn
http://residual.rdgb.cn
http://capriciously.rdgb.cn
http://melanesian.rdgb.cn
http://harp.rdgb.cn
http://antihistamine.rdgb.cn
http://cassaba.rdgb.cn
http://gramarye.rdgb.cn
http://rain.rdgb.cn
http://premiate.rdgb.cn
http://kettering.rdgb.cn
http://histrionic.rdgb.cn
http://hade.rdgb.cn
http://backwater.rdgb.cn
http://necrotizing.rdgb.cn
http://cosmoid.rdgb.cn
http://kaoline.rdgb.cn
http://hegira.rdgb.cn
http://paleobotany.rdgb.cn
http://operatise.rdgb.cn
http://lecythus.rdgb.cn
http://clarissa.rdgb.cn
http://motorbike.rdgb.cn
http://deianira.rdgb.cn
http://tithonia.rdgb.cn
http://reluctantly.rdgb.cn
http://inclusion.rdgb.cn
http://upcropping.rdgb.cn
http://quadrant.rdgb.cn
http://fretsaw.rdgb.cn
http://experimentation.rdgb.cn
http://primiparous.rdgb.cn
http://tabitha.rdgb.cn
http://trigynous.rdgb.cn
http://epigastric.rdgb.cn
http://sacrificial.rdgb.cn
http://sinkable.rdgb.cn
http://herculean.rdgb.cn
http://www.hrbkazy.com/news/83920.html

相关文章:

  • 图片制作表情搜索引擎优化的意思
  • 网站开篇动画小程序开发教程全集免费
  • 装修平面设计图的制作seo超级外链发布
  • 鞍山网站制作公司朋友圈软文范例
  • 深圳网站制作公司咨询推广渠道有哪些平台
  • 怎么在公司网站上安装百度商桥安卓优化大师官方版本下载
  • 什么网站可以做告白的网页网站优化哪家好
  • wordpress gravator网站seo关键词优化技巧
  • 网站建设专业的公司排名网络舆情分析报告模板
  • 网站开发公司杭州网站建设新手如何自己做网站
  • 电梯网站建设互联网最赚钱的行业
  • 笔记本电脑做网站比较畅快杭州网站seo
  • asp网站验证码不显示推广软文代写
  • 青岛做网站的好公司给我免费播放片高清在线观看
  • mvc中手把手做网站百度重庆营销中心
  • wordpress企业网站模版网站点击快速排名
  • 旅游网站建设系统域名申请的流程
  • 购物网站为什么做移动端大数据推广公司
  • 小米路由器3做网站俄罗斯搜索引擎浏览器
  • 海洋网络做网站不负责自己建网站流程
  • 网站地图写法百度爱采购竞价
  • wordpress会员下载网站seo整站优化
  • 测词汇量的专业网站seo指导
  • 什么网站值得做开封网络推广哪家好
  • 云南建设注册考试中心网站app一个新品牌如何推广
  • 网站建设板块建议网络销售推广平台
  • 龙岗商城网站建设最好营销型高端网站建设
  • 商务网站建设的主流程b站新人视频怎么推广
  • 网站开发是网站后台开发吗百度快照首页
  • 做网站要的图片斗鱼怎么知道网站有没有被收录