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

焦作建设厅网站esxi WordPress

焦作建设厅网站,esxi WordPress,app制作价格,鲁中网站前言 有了前面的知识积累#xff0c;我们这里做两个小练习#xff0c;都要灵活运用前面的知识。 First 需求 根据美国/英国各自YouTube的数据#xff0c;绘制出各自的评论数量的直方图 第一版 import numpy as np from matplotlib import pyplot as plt import matplo…前言 有了前面的知识积累我们这里做两个小练习都要灵活运用前面的知识。 First 需求 根据美国/英国各自YouTube的数据绘制出各自的评论数量的直方图 第一版 import numpy as np from matplotlib import pyplot as plt import matplotlib matplotlib.rc(font,familyFangSong)# 文件的路径 us_file_path./youtube_video_data/US_video_data_numbers.csv uk_file_path./youtube_video_data/GB_video_data_numbers.csv# 读取文件 t_usnp.loadtxt(us_file_path,delimiter,,dtypeint) t_uknp.loadtxt(uk_file_path,delimiter,,dtypeint)\uk_comment t_uk[:,-1]d50000 num (uk_comment.max()-uk_comment.min())//dplt.figure(figsize(20,8),dpi200) plt.hist(uk_comment,num) plt.show() 很明显这里很多评论都是小于5000甚至3000很多区间都没什么数据。所以我们要修改只统计小于3000的数据。 第二版 import numpy as np from matplotlib import pyplot as plt import matplotlib matplotlib.rc(font,familyFangSong)# 文件的路径 us_file_path./youtube_video_data/US_video_data_numbers.csv uk_file_path./youtube_video_data/GB_video_data_numbers.csv# 读取文件 t_usnp.loadtxt(us_file_path,delimiter,,dtypeint) t_uknp.loadtxt(uk_file_path,delimiter,,dtypeint)uk_comment t_uk[:,-1]temp_uk_comment uk_comment[uk_comment3000] d300 num (temp_uk_comment.max()-temp_uk_comment.min())//dplt.figure(figsize(20,8),dpi200) plt.title(英国YouTube评论分布直方图) plt.xlabel(评论数) plt.hist(temp_uk_comment,num) plt.show() import numpy as np from matplotlib import pyplot as plt import matplotlib matplotlib.rc(font,familyFangSong)# 文件的路径 us_file_path./youtube_video_data/US_video_data_numbers.csv uk_file_path./youtube_video_data/GB_video_data_numbers.csv# 读取文件 t_usnp.loadtxt(us_file_path,delimiter,,dtypeint) t_uknp.loadtxt(uk_file_path,delimiter,,dtypeint)us_comment t_us[:,-1]temp_us_comment us_comment[us_comment3000] d300 num (temp_us_comment.max()-temp_us_comment.min())//dplt.figure(figsize(20,8),dpi200) plt.title(美国YouTube评论分布直方图) plt.xlabel(评论数) plt.hist(temp_us_comment,num) plt.show() Second 需求 绘制图形来了解英国的YouTube中视频评论和喜欢数的关系. 第一版 import numpy as np from matplotlib import pyplot as plt import matplotlib matplotlib.rc(font,familyFangSong)# 文件的路径 us_file_path./youtube_video_data/US_video_data_numbers.csv uk_file_path./youtube_video_data/GB_video_data_numbers.csv# 读取文件 t_usnp.loadtxt(us_file_path,delimiter,,dtypeint) t_uknp.loadtxt(uk_file_path,delimiter,,dtypeint)uk_like t_uk[:,1] uk_commentt_uk[:,-1]plt.figure(figsize(20,8),dpi200) plt.scatter(uk_comment,uk_like) plt.show() 很明显数据分布在0-3000太密集了而在3000的部分分布的太稀疏了所以我们就要调整。 但是这次和上面的有点一些不一样不能直接对uk_like或者uk_comment切片因为我们画的是散点图两种变量的要一一对应。所以我们只能对原数据t_uk进行切片。 第二版 import numpy as np from matplotlib import pyplot as plt import matplotlib matplotlib.rc(font,familyFangSong)# 文件的路径 us_file_path./youtube_video_data/US_video_data_numbers.csv uk_file_path./youtube_video_data/GB_video_data_numbers.csv# 读取文件 t_usnp.loadtxt(us_file_path,delimiter,,dtypeint) t_uknp.loadtxt(uk_file_path,delimiter,,dtypeint)temp_ukt_uk[t_uk[:,-1]3000]temp_uk_commenttemp_uk[:,-1] temp_uk_liketemp_uk[:,1]plt.figure(figsize(20,8),dpi200) plt.xlabel(评论) plt.ylabel(点赞数) plt.title(英国YouTube--点赞与评论的关系) plt.scatter(temp_uk_comment,temp_uk_like) plt.show() import numpy as np from matplotlib import pyplot as plt import matplotlib matplotlib.rc(font,familyFangSong)# 文件的路径 us_file_path./youtube_video_data/US_video_data_numbers.csv uk_file_path./youtube_video_data/GB_video_data_numbers.csv# 读取文件 t_usnp.loadtxt(us_file_path,delimiter,,dtypeint) t_uknp.loadtxt(uk_file_path,delimiter,,dtypeint)temp_ust_us[t_us[:,-1]30000]temp_us_commenttemp_us[:,-1] temp_us_liketemp_us[:,1]print(temp_uk_comment,temp_uk_like)plt.figure(figsize(20,8),dpi200) plt.xlabel(评论) plt.ylabel(点赞数) plt.title(美国YouTube--点赞与评论的关系) plt.scatter(temp_us_comment,temp_us_like) plt.show()
http://www.pierceye.com/news/967416/

相关文章:

  • 昆明几大网站学生网站建设实训总结
  • 丽江手机网站建设建设公司起名大全
  • seo网站分析工具wordpress的安装包
  • 北京网站建设报价表徐州专业做网站
  • 怎样做网站卖网站国内免费开源crm
  • wordpress多语言网站济宁住房和城乡建设厅网站
  • 免费crm网站下载网站建设 繁体
  • 东莞企业官方网站建设网站建设对产品推销作用大吗
  • php网站路径问题站长工具权重查询
  • 箱包官方网站模板摄影后期教程网站
  • iis 手机网站同域名网站改版需要把之前网站里的文章都拷贝过来吗?
  • 网站是专门对生活中的一些所谓常识做辟谣的商标设计网站排行
  • seo网站设计营销工具抽奖网站插件
  • 家装设计网站大全网站建设用哪个好
  • 青海企业网站建设企业建设网
  • 电子商务网站环境建设怎么劝客户做网站
  • 山西教育学会的网站建设网站投放广告教程
  • 游戏网站的设计方案做装修业务呢有多少网站
  • 口碑好网站建设公司电话百度联盟网站备案信息
  • 网站建设排行公司建筑网页设计详情
  • 德国的网站后缀技术支持 东莞网站建设母婴护理
  • 彩票娱乐网站建设wordpress 邮件推送
  • 如何申请网站备案如何选择邯郸做网站
  • 专注做一家男生最爱的网站北京旅游设计网站建设
  • c 做网站凡科网站免费版怎么做
  • 门户网站开发多少钱wordpress主题文章页面不显示
  • 网站建设丶金手指下拉13个人网站有什么用
  • 企业网站建设解决方案wordpress搜索不了中文linux
  • 怎样在网站上做有效的广告投放手机网站公司哪家好
  • 四川德行天下建设工程有限公司网站ie兼容所有网站