版本0.14.1(2014年7月11日)#
这是从0.14.0发布的一个小版本,包括少量的API更改、几个新功能、增强功能和性能改进,以及大量的错误修复。我们建议所有用户升级到此版本。
亮点包括:
新方法
select_dtypes()根据数据类型和sem()计算平均数的标准误差。支持Dateutil时区(请参见 docs )。
中忽略整行注释的支持
read_csv()文本解析器。关于以下内容的新文档部分 Options and Settings 。
修复了很多错误。
API更改#
Openpyxl现在在构建Openpyxl编写器时引发ValueError,而不是对Pandas进口发出警告 (GH7284 )。
For
StringMethods.extract, when no match is found, the result - only containingNaNvalues - now also hasdtype=objectinstead offloat(GH7242)Period对象不再引发TypeError使用以下选项进行比较时==使用另一个对象,该对象 不是吗 一个Period。相反,在比较Period使用另一个对象使用==如果另一个对象不是PeriodFalse返回。 (GH7376 )以前,重置时间或不重置时间的行为
offsets.apply,rollforward和rollback不同偏移量的操作有所不同。在世界银行的支持下normalize关键字对于所有偏移量(见下文),默认为假(保留时间),针对某些偏移量(BusinessMonthBegin、MonthEnd、BusinessMonthEnd、CustomBusinessMonthEnd、BusinessYearBegin、LastWeekOfMonth、FY5253 Quarter、LastWeekOfMonth、Easter)更改的行为:In [6]: from pandas.tseries import offsets In [7]: d = pd.Timestamp('2014-01-01 09:00') # old behaviour < 0.14.1 In [8]: d + offsets.MonthEnd() Out[8]: pd.Timestamp('2014-01-31 00:00:00')
从0.14.1开始,所有偏移量默认保留时间。旧的行为可以通过以下方式获得
normalize=True# new behaviour In [1]: d + offsets.MonthEnd() Out[1]: Timestamp('2014-01-31 09:00:00') In [2]: d + offsets.MonthEnd(normalize=True) Out[2]: Timestamp('2014-01-31 00:00:00')
请注意,对于其他偏移量,默认行为不会更改。
向后添加
#N/A N/A作为文本分析中的默认NA值(从0.12回归) (GH5521 )Raise a
TypeErroron inplace-setting with a.whereand a nonnp.nanvalue as this is inconsistent with a set-item expression likedf[mask] = None(GH7656)
增强#
Add
dropnaargument tovalue_countsandnunique(GH5569).添加
select_dtypes()允许基于数据类型选择列的方法 (GH7316 )。看见 the docs 。全
offsets支持normalize关键字来指定是否offsets.apply,rollforward和rollback重置时间(小时、分钟等)或不重置(默认False,节省时间) (GH7156 ):import pandas.tseries.offsets as offsets day = offsets.Day() day.apply(pd.Timestamp("2014-01-01 09:00")) day = offsets.Day(normalize=True) day.apply(pd.Timestamp("2014-01-01 09:00"))
PeriodIndexis represented as the same format asDatetimeIndex(GH7601)StringMethods现在处理空系列 (GH7242 )文件解析器
read_csv和read_table现在忽略参数提供的行注释comment,它只接受C读取器的单个字符。特别是,它们允许在文件数据开始之前进行注释 (GH2685 )添加
NotImplementedError用于同时使用chunksize和nrowsFor Read_CSV() (GH6774 )。公共S3存储桶的基本读取测试现已存在 (GH7281 )。
read_html现在是体育运动和encoding传递给基础分析器库的参数。您可以使用它来读取非ASCII编码的网页 (GH7323 )。read_excel现在支持读取URL的方式与read_csv确实如此。 (GH6809 )支持Dateutil时区,现在可以像Pandas的PYTZ时区一样使用Dateutil时区。 (GH4688 )
In [3]: rng = pd.date_range( ...: "3/6/2012 00:00", periods=10, freq="D", tz="dateutil/Europe/London" ...: ) ...: In [4]: rng.tz Out[4]: tzfile('/usr/share/zoneinfo/Europe/London')
看见 the docs 。
Implemented
sem(standard error of the mean) operation forSeries,DataFrame,Panel, andGroupby(GH6897)添加
nlargest和nsmallest发送到SeriesgroupbyAllowlist,这意味着您现在可以在SeriesGroupBy对象 (GH7053 )。All offsets
apply,rollforwardandrollbackcan now handlenp.datetime64, previously results inApplyTypeError(GH7452)Period和PeriodIndex可以包含NaT在其价值上 (GH7485 )支持酸洗
Series,DataFrame和Panel具有非唯一标签的对象 item 轴心 (index,columns和items分别) (GH7370 )。改进了对混合空对象的DateTime/TimeDelta的推断。从具有全部空元素的对象索引的解释中的0.13.1回归 (GH7431 )
性能#
Improvements in dtype inference for numeric operations involving yielding performance gains for dtypes:
int64,timedelta64,datetime64(GH7223)改进了Series.Transform以实现显著的性能提升 (GH6496 )
使用uuncs和内置Grouper函数对DataFrame.Transform进行了改进,从而显著提高了性能 (GH7383 )
按日期时间64 dtype聚合分组中的回归 (GH7555 )
改进了
MultiIndex.from_product对于大型可迭代程序 (GH7627 )
实验性的#
错误修复#
窃听
DataFrame.where具有对称形状的框架和传递的DataFrame的另一个 (GH7506 )使用多索引轴的面板索引中出现错误 (GH7516 )
具有重复索引和非精确端点的类日期时间片索引中的回归 (GH7523 )
列表列表和单一VS混合类型的集合中存在错误 (GH7551 :)
非对齐系列中的时间错误操作 (GH7500 )
赋值不完整级数时时间增量推断中的错误 (GH7592 )
Groupby中的错误
.nth具有系列和类似整数的列名 (GH7559 )窃听
Series.get使用布尔访问器 (GH7407 )窃听
value_counts哪里NaT不符合失踪的条件 (NaN) (GH7423 )Bug in line plot doesn't set correct
xlimifsecondary_y=True(GH7459)分组中的错误
hist和scatter情节使用旧的figsize默认设置 (GH7394 )使用绘制子图时出现错误
DataFrame.plot,hist已通过许可ax即使次要情节的数量是一个 (GH7391 )。使用绘制子图时出现错误
DataFrame.boxplot使用by千瓦加薪ValueError如果次要情节的数量超过1 (GH7391 )。子图显示中的错误
ticklabels和labels在不同的规则中 (GH5897 )窃听
Panel.apply以多索引为轴 (GH7469 )Bug in
DatetimeIndex.insertdoesn't preservenameandtz(GH7299)Bug in
DatetimeIndex.asobjectdoesn't preservename(GH7299)使用类似日期时间的范围(字符串和时间戳)进行多索引切片时出现错误, (GH7429 )
窃听
Index.min和max不能处理nan和NaT恰如其分 (GH7261 )Bug in
PeriodIndex.min/maxresults inint(GH7609)Bug in
resamplewherefill_methodwas ignored if you passedhow(GH2073)Bug in
TimeGrouperdoesn't exclude column specified bykey(GH7227)窃听
DataFrame和SeriesBar和Barh阴谋增加TypeError什么时候bottom和left已指定关键字 (GH7226 )窃听
DataFrame.hist加薪TypeError当它包含非数字列时 (GH7277 )窃听
Index.delete不会保留name和freq属性 (GH7302 )窃听
DataFrame.query()/eval其中带有@符号的本地字符串变量被视为尝试删除的临时变量 (GH7300 )。窃听
Float64Index它不允许重复 (GH7149 )。窃听
DataFrame.replace()在那里真实的价值观正在被取代 (GH7140 )。窃听
StringMethods.extract()其中,单个匹配组系列赛将使用匹配者的名称而不是组名 (GH7313 )。Bug in
isnull()whenmode.use_inf_as_null == Truewhere isnull wouldn't testTruewhen it encountered aninf/-inf(GH7315).对于东半球时区,INFERFERED_FREQ中的错误导致无错误 (GH7310 )
窃听
Easter偏移量为负数时返回错误的日期 (GH7195 )广播中的错误与
.div、整型数据类型和被零除 (GH7325 )窃听
CustomBusinessDay.apply加薪NameError什么时候np.datetime64对象被传递 (GH7196 )窃听
MultiIndex.append,concat和pivot_table不保留时区 (GH6606 )窃听
.loc在单个-多个索引级(即不嵌套)上具有索引器列表 (GH7349 )窃听
Series.map当映射具有不同长度的元组关键字的词典时 (GH7333 )全部错误
StringMethods现在处理空系列 (GH7242 )修复委派
read_sql至read_sql_query当查询不包含‘SELECT’时 (GH7324 )。Bug where a string column name assignment to a
DataFramewith aFloat64Indexraised aTypeErrorduring a call tonp.isnan(GH7366).BUG在哪里
NDFrame.replace()未正确将对象替换为Period值 (GH7379 )。窃听
.ixGetitem应始终返回一个序列 (GH7150 )使用不完整索引器的多索引切片中的错误 (GH7399 )
切片级别中的一个步骤的多索引切片中的错误 (GH7400 )
错误,其中负索引器位于
DatetimeIndex没有正确切片 (GH7408 )Bug where
NaTwasn't repr'd correctly in aMultiIndex(GH7406, GH7409).Bug where bool objects were converted to
naninconvert_objects(GH7416).窃听
quantile忽略AXIS关键字参数 (GH7306 )BUG在哪里
nanops._maybe_null_out不适用于复数 (GH7353 )BUG中的几个
nanops在以下情况下的功能axis==0对于一维nan阵列 (GH7354 )Bug where
nanops.nanmediandoesn't work whenaxis==None(GH7352)BUG在哪里
nanops._has_infs不适用于许多数据类型 (GH7357 )窃听
StataReader.data其中读取0-观察DTA失败 (GH7369 )窃听
StataReader读取包含固定宽度字符串的Stata 13(117)文件时 (GH7360 )窃听
StataWriter其中忽略了编码 (GH7286 )窃听
DatetimeIndex比较不能处理NaT恰如其分 (GH7529 )Bug in passing input with
tzinfoto some offsetsapply,rollforwardorrollbackresetstzinfoor raisesValueError(GH7465)Bug in
DatetimeIndex.to_period,PeriodIndex.asobject,PeriodIndex.to_timestampdoesn't preservename(GH7485)窃听
DatetimeIndex.to_period和PeriodIndex.to_timestamp手柄NaT不正确 (GH7228 )Bug in
offsets.apply,rollforwardandrollbackmay return normaldatetime(GH7502)Bug in
resampleraisesValueErrorwhen target containsNaT(GH7227)窃听
Timestamp.tz_localize重置nanosecond信息 (GH7534 )Bug in
DatetimeIndex.asobjectraisesValueErrorwhen it containsNaT(GH7539)窃听
Timestamp.__new__不能正确保存纳秒 (GH7610 )Bug in
Index.astype(float)where it would return anobjectdtypeIndex(GH7464).Bug in
DataFrame.reset_indexlosestz(GH3950)Bug in
DatetimeIndex.freqstrraisesAttributeErrorwhenfreqisNone(GH7606)Bug in
GroupBy.sizecreated byTimeGrouperraisesAttributeError(GH7453)单栏条形图中的错误未对齐 (GH7498 )。
Bug in area plot with tz-aware time series raises
ValueError(GH7471)BUG in非单调
Index.union可以保存name不正确 (GH7458 )窃听
DatetimeIndex.intersection不保留时区 (GH4690 )窃听
rolling_var如果窗口比数组大,则会引发错误 (GH7297 )Bug with last plotted timeseries dictating
xlim(GH2960)Bug with
secondary_yaxis not being considered for timeseriesxlim(GH3490)窃听
Float64Index使用非标量索引器进行赋值 (GH7586 )Bug in
pandas.core.strings.str_containsdoes not properly match in a case insensitive fashion whenregex=Falseandcase=False(GH7505)窃听
expanding_cov,expanding_corr,rolling_cov,以及rolling_corr对于索引不匹配的两个参数 (GH7512 )窃听
to_sql将布尔列作为文本列 (GH7678 )分组中的错误
hist不能处理rot千瓦和sharex适当的千瓦 (GH7234 )窃听
.loc使用执行回退整数索引object数据类型索引 (GH7496 )中的错误(回归)
PeriodIndex传递时的构造函数Series对象 (GH7701 )。
贡献者#
共有46人为此次发布贡献了补丁。名字中带有“+”的人第一次贡献了一个补丁。
Andrew Rosenfeld
Andy Hayden
Benjamin Adams +
Benjamin M. Gross +
Brian Quistorff +
Brian Wignall +
DSM
Daniel Waeber
David Bew +
David Stephens
Jacob Schaer
Jan Schulz
John David Reaver
John W. O'Brien
Joris Van den Bossche
Julien Danjou +
K.-Michael Aye
Kevin Sheppard
Kyle Meyer
Matt Wittmann
Matthew Brett +
Michael Mueller +
Mortada Mehyar
Phillip Cloud
Rob Levy +
Schaer, Jacob C +
Stephan Hoyer
Thomas Kluyver
Todd Jennings
Tom Augspurger
TomAugspurger
bwignall
clham
dsm054 +
helger +
immerrr
jaimefrio
jreback
lexual
onesandzeroes
rockg
sanguineturtle +
seth-p +
sinhrks
unknown
yelite +