0.24.2 版本新特性 (2019年3月12日)#

警告

0.24.x 系列版本将是最后一个支持 Python 2 的版本。未来的功能版本将仅支持 Python 3。详情请参阅 停止支持 Python 2.7

以下是 pandas 0.24.2 中的更改。请参阅 发行说明 以获取包括其他 pandas 版本在内的完整更新日志。

修复的回归#

  • 修复了 DataFrame.all()DataFrame.any()bool_only=True 被忽略的回归 (GH 25101)

  • 修复了 DataFrame 构造时传递混合类型列表可能导致段错误的问题。 (GH 25075)

  • 修复了 DataFrame.apply()dict 类似类作为参数传入时导致 RecursionError 的回归。 (GH 25196)

  • 修复了 DataFrame.replace()regex=True 仅替换匹配字符串开头的模式的回归 (GH 25259)

  • 修复了 DataFrame.duplicated() 中空 DataFrame 未返回布尔类型 Series 的回归。 (GH 25184)

  • 修复了 Series.min()Series.max() 中当 Series 包含 Categorical 数据时 numeric_only=True 被忽略的回归 (GH 25299)

  • 修复了 datetime64[ns] dtype 的 Series 对象之间相减时,当右侧 Series 包含空值时错误地引发 OverflowError 的回归 (GH 25317)

  • 修复了 TimedeltaIndexnp.sum(index) 错误地返回了零维对象而非标量的回归 (GH 25282)

  • 修复了 IntervalDtype 构造时,传递带有 'Interval' 前缀的错误字符串可能导致 RecursionError 的回归。 (GH 25338)

  • 修复了从只读 NumPy 周期对象数组创建 period-dtype 数组的回归。 (GH 25403)

  • 修复了 Categorical 中,从分类 Series 和显式 categories= (与 Series 中的不同) 构造时,创建了一个可能触发段错误的无效对象的回归。 (GH 25318)

  • 修复了 to_timedelta() 将浮点数据转换为 Timedelta 数据时丢失精度的回归 (GH 25077)。

  • 修复了在没有 NumPy 的环境中从源代码安装 pip 的问题 (GH 25193)

  • 修复了 DataFrame.replace() 中,大量数字字符串被强制转换为 int64 导致 OverflowError 的回归 (GH 25616)

  • 修复了 factorize() 在传递自定义 na_sentinel 值和 sort=True 时出现的回归 (GH 25409)。

  • 修复了 DataFrame.to_csv() 在使用 gzip 压缩时写入重复行尾的回归 (GH 25311)

错误修复#

输入/输出

  • 改进了当终端尺寸未知时终端打印的处理方式 (GH 25080)

  • 修复了在 Python 3 中读取 Python 2 创建的 HDF5 表格式 DataFrame 时的错误 (GH 24925)

  • 修复了读取由 DataFrame.to_json() 通过 orient='table' 且带有 index=False 生成的 JSON 时的错误 (GH 25170)

  • 修复了浮点索引在打印时可能出现值错位的问题 (GH 25061)

分类数据

重塑

可视化

其他

  • 修复了 Series.is_unique() 中,NaN 的单一出现未被视为唯一的错误 (GH 25180)

  • 修复了 merge() 在合并空 DataFrame 与包含 Int64 列的 DataFrame,或合并非空 DataFrame 与包含全部为 NaNInt64 列的 DataFrame 时出现的错误 (GH 25183)

  • 修复了 IntervalTree 中,在构造时因添加端点溢出而发生 RecursionError,这也导致 IntervalIndex 在索引操作期间崩溃的错误 (GH 25485)

  • 修复了 Series.size 对于某些由扩展数组支持的 Series 引发错误而不是返回大小的错误 (GH 25580)

  • 修复了可空整数类型列进行重采样时引发错误的问题 (GH 25580)

贡献者#

共有 25 人为本次发布贡献了补丁。名字旁带有“+”的人员是首次贡献补丁。

  • Albert Villanova del Moral

  • Arno Veenstra +

  • chris-b1

  • Devin Petersohn +

  • EternalLearner42 +

  • Flavien Lambert +

  • gfyoung

  • Gioia Ballin

  • jbrockmendel

  • Jeff Reback

  • Jeremy Schendel

  • Johan von Forstner +

  • Joris Van den Bossche

  • Josh

  • Justin Zheng

  • Kendall Masse

  • Matthew Roeschke

  • Max Bolingbroke +

  • rbenes +

  • Sterling Paramore +

  • Tao He +

  • Thomas A Caswell

  • Tom Augspurger

  • Vibhu Agarwal +

  • William Ayd

  • Zach Angell