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 未返回布尔 dtype 的 Series 的回归错误 (GH 25184)

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

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

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

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

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

  • 修复了 Categorical 中,从分类 Series 和与 Series 中不同的显式 categories= 构造时创建了可能触发段错误的无效对象的回归错误 (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() 并设置 index=False 生成的 orient='table' 格式 JSON 的错误 (GH 25170)

  • 修复了打印时浮点索引可能出现值未对齐的错误 (GH 25061)

分类数据

重塑

  • 修复了 GroupBy.transform() 中的错误,将函数应用于时区感知列会返回时区不感知的结果 (GH 24198)

  • 修复了 DataFrame.join() 在通过时区感知 DatetimeIndex 连接时的错误 (GH 23931)

可视化

其他

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

  • 修复了 merge() 中,合并空 DataFrame 与 Int64 列,或合并非空 DataFrame 与全部为 NaN 的 Int64 列时的错误 (GH 25183)

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

  • 修复了 Series.size 对某些扩展数组支持的 Series 抛出错误而非返回大小的错误 (GH 25580)

  • 修复了对可空整型 dtype 列重采样时抛出错误的错误 (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