0.21.1版(2017年12月12日)#
这是0.21.x系列中的一个较小的错误修复版本,包括一些小的回归修复、错误修复和性能改进。我们建议所有用户升级到此版本。
亮点包括:
暂时恢复matplotlib日期时间打印功能。这应该会解决那些隐含地依赖Pandas来使用matplotlib绘制日期时间的用户的问题。看见 here 。
对0.21.0中引入的拼图IO函数的改进。看见 here 。
V0.21.1中的新特性
恢复Matplotlib日期时间转换器注册#
Pandas实现了一些matplotlib转换器,用于很好地格式化地块上的轴标签 datetime
或 Period
价值观。在Pandas0.21.0之前,这些都是在matplotlib隐式注册的,作为 import pandas
。
在Pandas 0.21.0中,我们要求用户显式注册转换器。这给一些经常依赖这些转换器的用户带来了问题 matplotlib.pyplot
绘图方法,所以我们暂时恢复该更改;Pandas 0.21.1再次在导入时注册转换器,就像0.21.0之前一样。
我们添加了一个新的选项来控制转换器: pd.options.plotting.matplotlib.register_converters
。默认情况下,它们是注册的。将此选项切换为 False
删除Pandas的格式化程序并恢复我们在注册它们时覆盖的任何转换器 (GH18301 )。
我们正在与matplotlib开发人员合作,让这件事变得更容易。我们正在尝试平衡用户便利性(自动注册转换器)与导入性能和最佳实践(导入Pandas不应该有覆盖您已经设置的任何自定义转换器的副作用)。在未来,我们希望在matplotlib中拥有大部分日期时间格式化功能,只在Pandas中使用特定于Pandas的转换器。然后,我们将优雅地反对自动注册转换器,转而支持用户在需要时显式注册它们。
新功能#
对拼花IO功能的改进#
DataFrame.to_parquet()
will now write non-default indexes when the underlying engine supports it. The indexes will be preserved when reading back in withread_parquet()
(GH18581).read_parquet()
现在允许指定要从拼图文件中读取的列 (GH18154 )read_parquet()
现在允许指定传递给相应引擎的kwarg (GH18216 )
其他增强功能#
Timestamp.timestamp()
现在可以在Python2.7中使用。 (GH17329 )
不推荐使用#
pandas.tseries.register
has been renamed topandas.plotting.register_matplotlib_converters()
(GH18301)
性能改进#
提高了绘制大系列/数据帧的性能 (GH18236 )。
错误修复#
转换#
窃听
TimedeltaIndex
在以下情况下,减法可能会错误地溢出NaT
都在现场 (GH17791 )窃听
DatetimeIndex
从DatetimeIndex中减去类DateTime可能无法溢出 (GH18020 )Bug in
IntervalIndex.copy()
when copying andIntervalIndex
with non-defaultclosed
(GH18339)Bug in
DataFrame.to_dict()
where columns of datetime that are tz-aware were not converted to required arrays when used withorient='records'
, raisingTypeError
(GH18372)窃听
DateTimeIndex
和date_range()
哪里不匹配TZ-Awarestart
和end
在以下情况下,时区不会引发错误end.tzinfo
为None (GH18431 )窃听
Series.fillna()
当在Python2上传递一个长整数时引发 (GH18159 )。
标引#
的布尔比较中的错误
datetime.datetime
和一个datetime64[ns]
DType系列 (GH17965 )BUG,其中
MultiIndex
有100多万张唱片没有筹集到AttributeError
当尝试访问缺少的属性时 (GH18165 )Bug in
IntervalIndex
constructor when a list of intervals is passed with non-defaultclosed
(GH18334)窃听
Index.putmask
当传递无效掩码时 (GH18368 )掩码赋值中的错误
timedelta64[ns]
数据类型Series
,被错误地强制浮动 (GH18493 )
IO#
窃听
StataReader
不转换显示格式已寻址的日期/时间列 (GH17990 )。以前,带有显示格式的列通常保留为序号,不会转换为DateTime对象。窃听
read_csv()
读取压缩的UTF-16编码文件时 (GH18071 )Bug in
read_csv()
for handling null values in index columns when specifyingna_filter=False
(GH5239)窃听
read_csv()
读取基数较高的数值类别字段时 (GH18186 )Bug in
DataFrame.to_csv()
when the table hadMultiIndex
columns, and a list of strings was passed in forheader
(GH5539)Bug in parsing integer datetime-like columns with specified format in
read_sql
(GH17855).窃听
DataFrame.to_msgpack()
在序列化numpy.bool_
数据类型 (GH18390 )窃听
read_json()
从S3读取行分隔的JSON时未解码 (GH17200 )Bug in
pandas.io.json.json_normalize()
to avoid modification ofmeta
(GH18610)窃听
to_latex()
即使更高级别的索引与前一行不同,也不会打印重复的多索引值 (GH14484 )Bug when reading NaN-only categorical columns in
HDFStore
(GH18413)窃听
DataFrame.to_latex()
使用longtable=True
其中 Latex 多柱总是跨越三个柱 (GH17959 )
标绘#
窃听
DataFrame.plot()
和Series.plot()
使用DatetimeIndex
其中由它们生成的图形在Python3中不可拾取 (GH18439 )
分组依据/重采样/滚动#
重塑#
数字#
窃听
pd.Series.rolling.skew()
和rolling.kurt()
具有所有相等的值具有浮动问题 (GH18044 )
直截了当的#
窃听
DataFrame.astype()
其中,强制转换为空的DataFrame
导致分段故障 (GH18004 )Error messages in the testing module have been improved when items have different
CategoricalDtype
(GH18069)CategoricalIndex
现在可以正确地接受pd.api.types.CategoricalDtype
作为其数据类型 (GH18116 )Bug in
Categorical.unique()
returning read-onlycodes
array when all categories wereNaN
(GH18051)Bug in
DataFrame.groupby(axis=1)
with aCategoricalIndex
(GH18432)
细绳#
Series.str.split()
will now propagateNaN
values across all expanded columns instead ofNone
(GH18450)
贡献者#
共有46人为此次发布贡献了补丁。名字中带有“+”的人第一次贡献了一个补丁。
Aaron Critchley +
Alex Rychyk
Alexander Buchkovsky +
Alexander Michael Schade +
Chris Mazzullo
Cornelius Riemenschneider +
Dave Hirschfeld +
David Fischer +
David Stansby +
Dror Atariah +
Eric Kisslinger +
Hans +
Ingolf Becker +
Jan Werkmann +
Jeff Reback
Joris Van den Bossche
Jörg Döpfert +
Kevin Kuhl +
Krzysztof Chomski +
Leif Walsh
Licht Takeuchi
Manraj Singh +
Matt Braymer-Hayes +
Michael Waskom +
Mie~~~ +
Peter Hoffmann +
Robert Meyer +
Sam Cohan +
Sietse Brouwer +
Sven +
Tim Swast
Tom Augspurger
Wes Turner
William Ayd +
Yee Mey +
bolkedebruin +
cgohlke
derestle-htwg +
fjdiod +
gabrielclow +
gfyoung
ghasemnaddaf +
jbrockmendel
jschendel
miker985 +
topper-123