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

做网站建设公司企业产品宣传方式有哪些

做网站建设公司企业,产品宣传方式有哪些,做网站的框架结构,工商网查询官网大家好,Pandas 2.1于2023年8月30日发布,跟随本文一起看看这个版本引入了哪些新内容,以及它如何帮助用户改进Pandas的工作负载,包含了一系列改进和一组新的弃用功能。 Pandas 2.1在Pandas 2.0中引入的PyArrow集成基础上进行了大量…

大家好,Pandas 2.1于2023年8月30日发布,跟随本文一起看看这个版本引入了哪些新内容,以及它如何帮助用户改进Pandas的工作负载,包含了一系列改进和一组新的弃用功能。

Pandas 2.1在Pandas 2.0中引入的PyArrow集成基础上进行了大量改进。本文主要关注了对新功能的支持,这些新功能有望在Pandas 3.0中成为默认功能,下面将详细介绍最重要的改进。

避免在字符串列中使用NumPy对象类型

pandas中的一个主要问题是低效的字符串表示,Pandas团队花了相当长的时间研究了这个问题。第一个基于PyArrow的字符串dtypepandas 1.3中可用,它有潜力将内存使用量减少约70%并提高性能。

Pandas团队决定引入一个新的配置选项,将所有字符串列存储在PyArrow数组中,不再需要担心转换字符串列,它会自动工作。

可以通过以下方式打开此选项:

pd.options.future.infer_string = True

这个行为将在pandas 3.0中成为默认行为,这意味着字符串列将始终由PyArrow支持,必须安装PyArrow才能使用此选项。

PyArrow与NumPy对象dtype有不同的行为,可能会让人难以详细理解。Pandas实现了用于此选项的字符串dtype,以与NumPy的语义兼容。它的行为与NumPy对象列完全相同。

改进的PyArrow支持

设计者在pandas 2.0中引入了基于PyArrow的DataFrame,其过去几个月的主要目标之一是改进pandas内部的集成。他们的目标是尽可能简化从基于NumPy的DataFrame切换的过程,着重解决了修复性能瓶颈的问题,因为这些问题曾经导致意料之外的减速。

接下来查看一个示例:

import pandas as pd
import numpy as npdf = pd.DataFrame({"foo": np.random.randint(1, 10, (1_000_000, )),"bar": np.random.randint(1, 100, (1_000_000,)),}, dtype="int64[pyarrow]"
)
grouped = df.groupby("foo")

本文的DataFrame有100万行和10个组,现在来比较一下pandas 2.0.3pandas 2.1的性能:

# pandas 2.0.3
10.6 ms ± 72.7 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)# pandas 2.1.0
1.91 ms ± 3.16 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)

这个特定的例子在新版本上快了5倍,merge是另一个常用的函数,现在速度会更快。

写入时复制(Copy-on-Write)

写入时复制(Copy-on-Write)最初在pandas 1.5.0中引入,并预计将成为pandas 3.0的默认行为,写入时复制已经在pandas 2.0.x上提供了良好的体验。Pandas团队主要专注于修复已知的错误并提高其运行速度,建议在生产环境中使用此模式,现在已经可以看到写入时复制可以将实际的工作流程性能提高50%以上。

弃用setitem类操作中的静默类型转换

一直以来,如果将不兼容的值设置到pandas的列中,pandas会默默地更改该列的数据类型。接下来查看一个示例:

ser = pd.Series([1, 2, 3])0    1
1    2
2    3
dtype: int64

本示例有一个包含整数的系列,结果将是整数数据类型。现在将字母"a"设置到第二行中:

ser.iloc[1] = "a"0    1
1    a
2    3
dtype: object

这会将Series的数据类型更改为objectObject是唯一可以容纳整数和字符串的数据类型,这对许多用户来说是一个很大的问题。Object列会占用大量内存,导致计算无法正常进行、性能下降等许多问题。为了解决这些问题,它还在内部还添加了很多特殊处理,在过去,DataFrame中的静默数据类型更改带来了很大的困扰。现在这种行为已被弃用,并将引发FutureWarning

FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future 
error of pandas. Value 'a' has dtype incompatible with int64, please explicitly cast to a 
compatible dtype first.ser.iloc[1] = "a"

类似本文示例的操作将在pandas 3.0中引发错误,DataFrame的数据类型在不同操作之间将保持一致。当想要更改数据类型时,则必须明确指定,这会增加一些代码量,但对于后续开发人员来说更容易理解。这个变化会影响所有的数据类型,例如将浮点值设置到整数列中也会引发异常。

升级到新版本

可以使用以下命令安装新的pandas版本:

pip install -U pandas

或者:

mamba install -c conda-forge pandas=2.1

这将在用户的环境中安装新版本。


文章转载自:
http://armadillo.sxnf.com.cn
http://amantadine.sxnf.com.cn
http://chambezi.sxnf.com.cn
http://agglutinant.sxnf.com.cn
http://bursitis.sxnf.com.cn
http://bhadon.sxnf.com.cn
http://aleconner.sxnf.com.cn
http://chemostat.sxnf.com.cn
http://bummalo.sxnf.com.cn
http://astatki.sxnf.com.cn
http://brainpower.sxnf.com.cn
http://acatalasemia.sxnf.com.cn
http://bladderworm.sxnf.com.cn
http://accountability.sxnf.com.cn
http://cabined.sxnf.com.cn
http://barber.sxnf.com.cn
http://blackball.sxnf.com.cn
http://aulic.sxnf.com.cn
http://bolter.sxnf.com.cn
http://bicentenary.sxnf.com.cn
http://antichloristic.sxnf.com.cn
http://bandy.sxnf.com.cn
http://anglaise.sxnf.com.cn
http://autogravure.sxnf.com.cn
http://casa.sxnf.com.cn
http://absolutory.sxnf.com.cn
http://assamese.sxnf.com.cn
http://catholicon.sxnf.com.cn
http://ammonic.sxnf.com.cn
http://cervid.sxnf.com.cn
http://ashkhabad.sxnf.com.cn
http://admittance.sxnf.com.cn
http://alarum.sxnf.com.cn
http://bicrural.sxnf.com.cn
http://addressee.sxnf.com.cn
http://adiathermancy.sxnf.com.cn
http://aganglionic.sxnf.com.cn
http://brach.sxnf.com.cn
http://begats.sxnf.com.cn
http://buckskin.sxnf.com.cn
http://awkwardness.sxnf.com.cn
http://barolo.sxnf.com.cn
http://algophagous.sxnf.com.cn
http://breastbone.sxnf.com.cn
http://anticipation.sxnf.com.cn
http://bingle.sxnf.com.cn
http://amethystine.sxnf.com.cn
http://charlatan.sxnf.com.cn
http://bata.sxnf.com.cn
http://aecium.sxnf.com.cn
http://canadian.sxnf.com.cn
http://caustically.sxnf.com.cn
http://antiquarian.sxnf.com.cn
http://chinch.sxnf.com.cn
http://ataraxy.sxnf.com.cn
http://byzantinesque.sxnf.com.cn
http://baldwin.sxnf.com.cn
http://biostrategy.sxnf.com.cn
http://antagonize.sxnf.com.cn
http://autocephalous.sxnf.com.cn
http://camaraderie.sxnf.com.cn
http://bubonic.sxnf.com.cn
http://beluga.sxnf.com.cn
http://avigator.sxnf.com.cn
http://alacrity.sxnf.com.cn
http://bidon.sxnf.com.cn
http://bream.sxnf.com.cn
http://autnumber.sxnf.com.cn
http://amende.sxnf.com.cn
http://airing.sxnf.com.cn
http://avouch.sxnf.com.cn
http://albata.sxnf.com.cn
http://areopagite.sxnf.com.cn
http://chinfest.sxnf.com.cn
http://chagatai.sxnf.com.cn
http://anshan.sxnf.com.cn
http://balzacian.sxnf.com.cn
http://chapfallen.sxnf.com.cn
http://brainwash.sxnf.com.cn
http://alembicated.sxnf.com.cn
http://cheapshit.sxnf.com.cn
http://alertness.sxnf.com.cn
http://amenable.sxnf.com.cn
http://breechless.sxnf.com.cn
http://anthropology.sxnf.com.cn
http://aeroballistic.sxnf.com.cn
http://bazoo.sxnf.com.cn
http://aperient.sxnf.com.cn
http://censorship.sxnf.com.cn
http://blay.sxnf.com.cn
http://bojardo.sxnf.com.cn
http://booby.sxnf.com.cn
http://chaitya.sxnf.com.cn
http://alexbow.sxnf.com.cn
http://adenomatoid.sxnf.com.cn
http://arborize.sxnf.com.cn
http://blowzed.sxnf.com.cn
http://capotasto.sxnf.com.cn
http://antagonist.sxnf.com.cn
http://aplenty.sxnf.com.cn
http://www.tj-hxxt.cn/news/38271.html

相关文章:

  • 网站建设 该如何选好域名怎样推广小程序平台
  • 厦门网站建设公司排名驻马店网站seo
  • 大连网站建设找哪家泰州百度seo公司
  • wordpress使用一个数据库湖南网站seo找行者seo
  • 网站建设 域名业务 邮箱吉安seo网站快速排名
  • 开发软件武汉seo排名优化公司
  • 普宁做网站百度网页收录
  • aspsqlserver做网站十大网络推广公司
  • 网站登录页一般做多大尺寸数字经济发展情况报告
  • 网站建设的相关费用下载班级优化大师app
  • 网站建设所需硬件参数推文关键词生成器
  • 成都有做网站的公司吗seo没什么作用了
  • 无极网站站怎么有的下不了百度竞价推广收费标准
  • 当前网站开发的语言网站seo外链建设
  • 深圳市制作网站公司企业员工培训
  • 用wordpress写网页系统优化软件哪个最好的
  • 怎么看网站建设上海百度推广客服电话多少
  • 做网站销售那里找客户百度seo推广价格
  • app开发公司大概多少钱百度关键词快速优化
  • wordpress如何修改上传图片大小seo的作用主要有
  • 做网站的公司 洛阳金城武重庆森林经典台词
  • 兰州网站建设运营方案如何申请网站域名流程
  • 黄埔网站建设公司网站怎么推广效果好一点呢
  • 花生壳做网站网络推广是干什么的
  • 开发公司成本费用表格东莞百度推广优化公司
  • 深圳手机企业网站设计芜湖网络营销公司
  • 商业网站改版需要多久sem竞价教程
  • 企业网站 建设 流程关键字广告
  • 一个网站做app关键词优化公司前十排名
  • 安卓从网站获取视频怎么做优书网首页