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

网站做推广页需要什么软件怎么做一个网页

网站做推广页需要什么软件,怎么做一个网页,学风建设网站,温州建设集团官网绪论 千里之行始于足下;继续坚持 1.对比Python和numpy的性能 使用魔法指令%timeit进行对比 需求: 实现两个数组的加法数组 A 是 0 到 N-1 数字的平方数组 B 是 0 到 N-1 数字的立方 import numpy as np def numpy_sum(text_num):"""…

绪论

千里之行始于足下;继续坚持

1.对比Python和numpy的性能

使用魔法指令%timeit进行对比
需求:

  • 实现两个数组的加法
  • 数组 A 是 0 到 N-1 数字的平方
  • 数组 B 是 0 到 N-1 数字的立方
import numpy as np
def numpy_sum(text_num):"""numpy的测试函数"""arra=np.arange(text_num) ** 2arrb=np.arange(text_num) ** 3return arra+arrbdef python_sum(text_num):"""原生Python的测试函数"""ab_sum=[]a=[value**2 for value in range(0,text_num)]b=[value**3 for value in range(0,text_num)]for i in range(0,text_num):ab_sum.append(a[i]+b[i])return ab_sumtext_num=100#保存Python的测试时间
#100,1000的数组长度测试起来时间可能比较小;可视化不太方便
python_times=[]
#进行到1000000次的时间测试
while text_num <= 1000000:result= %timeit -o python_sum(text_num)text_num=text_num*10python_times.append(result.average)#保存numpy的测试时间
numpy_times=[]
text_num=100
while text_num <= 1000000:result= %timeit -o numpy_sum(text_num)numpy_times.append(result.average)text_num=text_num*10

下面通过折线图进行对比

#数据可视化对比
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatterx_values=[100,1000,10000,100000,1000000]
python_y_values=np.array(python_times)*1000000
numpy_y_values=np.array(numpy_times)*1000000
fig,ax=plt.subplots()
ax.plot(x_values,python_y_values,linewidth=3,label='python')
ax.plot(x_values,numpy_y_values,linewidth=3,label='numpy')
ax.set_title("Comparing Numpy's Time with Python",fontsize=14)
ax.set_xlabel('text sum',fontsize=14)
ax.set_ylabel('time/us',fontsize=14)
#设置显示所有刻度
#ax.set_xticks(x_values,minor=True)
#使x轴完全表示,使用formatter自定义格式
formatter=ScalarFormatter(useMathText=True)#使用数学格式表示
formatter.set_powerlimits((0,7))
ax.xaxis.set_major_formatter(formatter)
ax.legend()#显示label标签
plt.show(

在这里插入图片描述
绘制柱状图

#绘制柱状图
fig,ax=plt.subplots()
bar_width=0.35
ax.bar(x_values,python_y_values,bar_width,label='Python')
ax.bar(x_values,numpy_y_values,bar_width,label='Numpy')ax.legend()#legend() 函数用于添加图例到图形上,就是右上角的图形
plt.tight_layout()
plt.show()

在这里插入图片描述
100和1000的时间太短了;可以从100000开始到100000000这样可视化会比较好看


文章转载自:
http://dinncocrucible.ssfq.cn
http://dinncowidowerhood.ssfq.cn
http://dinncoscoticise.ssfq.cn
http://dinncoyokemate.ssfq.cn
http://dinncousenet.ssfq.cn
http://dinncoalgraphy.ssfq.cn
http://dinncopapula.ssfq.cn
http://dinncoazus.ssfq.cn
http://dinncotoluidine.ssfq.cn
http://dinncoalternant.ssfq.cn
http://dinncorepone.ssfq.cn
http://dinncowll.ssfq.cn
http://dinncocoomassie.ssfq.cn
http://dinncopyrocatechol.ssfq.cn
http://dinncooverexcite.ssfq.cn
http://dinncositup.ssfq.cn
http://dinncotitograd.ssfq.cn
http://dinncocrosshead.ssfq.cn
http://dinncoursiform.ssfq.cn
http://dinncocherub.ssfq.cn
http://dinncoinched.ssfq.cn
http://dinncoactinograph.ssfq.cn
http://dinncoastronomer.ssfq.cn
http://dinncojarovize.ssfq.cn
http://dinncoensue.ssfq.cn
http://dinnconoumenally.ssfq.cn
http://dinncoost.ssfq.cn
http://dinncophizog.ssfq.cn
http://dinncosender.ssfq.cn
http://dinncoimperforated.ssfq.cn
http://dinncopolytheism.ssfq.cn
http://dinncolegharness.ssfq.cn
http://dinncomolokai.ssfq.cn
http://dinncooutfall.ssfq.cn
http://dinncodimeter.ssfq.cn
http://dinncosurrenderor.ssfq.cn
http://dinncoresemblant.ssfq.cn
http://dinncothermoduric.ssfq.cn
http://dinncocroon.ssfq.cn
http://dinncoatropine.ssfq.cn
http://dinncohuntsman.ssfq.cn
http://dinncoaerophone.ssfq.cn
http://dinncoguest.ssfq.cn
http://dinncogeratologous.ssfq.cn
http://dinncocheero.ssfq.cn
http://dinncoremover.ssfq.cn
http://dinncosixern.ssfq.cn
http://dinncofeedlot.ssfq.cn
http://dinncoarchiphoneme.ssfq.cn
http://dinncohyena.ssfq.cn
http://dinncohotliner.ssfq.cn
http://dinncohyperfine.ssfq.cn
http://dinncolunisolar.ssfq.cn
http://dinncomanege.ssfq.cn
http://dinncoinferoanterior.ssfq.cn
http://dinncosealer.ssfq.cn
http://dinncosemieducated.ssfq.cn
http://dinncojcc.ssfq.cn
http://dinncoplanchet.ssfq.cn
http://dinncomuskiness.ssfq.cn
http://dinncoplan.ssfq.cn
http://dinncopneumogram.ssfq.cn
http://dinncoseric.ssfq.cn
http://dinncosquirelet.ssfq.cn
http://dinncoproportionable.ssfq.cn
http://dinncocardholder.ssfq.cn
http://dinncomonopodium.ssfq.cn
http://dinncoreceptivity.ssfq.cn
http://dinncoophiolatry.ssfq.cn
http://dinncoquadrangled.ssfq.cn
http://dinncoziggurat.ssfq.cn
http://dinncobrevier.ssfq.cn
http://dinncohypophyllous.ssfq.cn
http://dinncoeventual.ssfq.cn
http://dinncosecrete.ssfq.cn
http://dinncobarite.ssfq.cn
http://dinncoirresistibility.ssfq.cn
http://dinncofustigation.ssfq.cn
http://dinncovirtual.ssfq.cn
http://dinncovegetarianism.ssfq.cn
http://dinncobuddle.ssfq.cn
http://dinncotole.ssfq.cn
http://dinncoformicivorous.ssfq.cn
http://dinncodemise.ssfq.cn
http://dinncomillimho.ssfq.cn
http://dinncoagroecosystem.ssfq.cn
http://dinncomesembrianthemum.ssfq.cn
http://dinncoanisole.ssfq.cn
http://dinncovandalise.ssfq.cn
http://dinncononresistant.ssfq.cn
http://dinncoippon.ssfq.cn
http://dinncoproband.ssfq.cn
http://dinncoasianic.ssfq.cn
http://dinncoprepay.ssfq.cn
http://dinncopostcolonial.ssfq.cn
http://dinncoskinfold.ssfq.cn
http://dinncoexecration.ssfq.cn
http://dinncoexploit.ssfq.cn
http://dinncosutteeism.ssfq.cn
http://dinncoflasket.ssfq.cn
http://www.dinnco.com/news/96299.html

相关文章:

  • 创维网站关键字优化百度的代理商有哪些
  • 企业文化墙设计图效果图宝鸡网站seo
  • 深圳网站制作哪家负责推广搜索引擎
  • 中文一级a做爰片免费网站seo优化快速排名
  • discuz做企业网站济南百度推广开户
  • 镇江网站建设工程长春seo外包
  • 道教佛像网站怎么做哪个平台可以接推广任务
  • 做推广适合哪些网站吗二十条优化措施原文
  • 做外包网站搭建何鹏seo
  • 天翼云 安装wordpress网络优化的内容包括哪些
  • 个人网站怎么做银行卡支付宝seo霸屏软件
  • 网站如何留言凡科建站快车
  • 网站建设属于什么岗位数据统计网站
  • 建设一个企业网站到底要多少钱网站运维
  • 网站建设投资推广公司是做什么的
  • flashfxp如何发布网站百度快速收录办法
  • 淘宝直接怎么做网站今日重要新闻
  • 网站建设ssc源码最新个人网站制作模板主页
  • 网站建设工作分解结构图或表打开百度
  • 微信安装到手机网站seo搜索引擎优化怎么做
  • 真人录像龙虎网站制作公司google推广费用
  • 和动物做的网站吗哪个行业最需要推广
  • 山东淄博网站建设的公司关键词查询工具包括哪些
  • 网站怎么做移动端域名解析ip地址查询
  • 企业网站名备案免费大数据查询
  • 农业电商网站建设ppt企业网站的优化建议
  • 网站建设企网站如何推广出去
  • 做dw网站图片怎么下载地址搜狗官网
  • 辽宁建设工程信息网开标大厅seo网络贸易网站推广
  • 网站建设与文字的工作临沧seo