0.25.1中的新特性(2019年8月21日)#

这些是Pandas0.25.1的变化。看见 发行说明 获取完整的更改日志,包括其他版本的Pandas。

IO和LZMA#

Some users may unknowingly have an incomplete Python installation lacking the lzma module from the standard library. In this case, import pandas failed due to an ImportError (GH27575). pandas will now warn, rather than raising an ImportError if the lzma module is not present. Any subsequent attempt to use lzma methods will raise a RuntimeError. A possible fix for the lack of the lzma module is to ensure you have the necessary libraries and then re-install Python. For example, on MacOS installing Python with pyenv may lead to an incomplete Python installation due to unmet system dependencies at compilation time (like xz). Compilation will succeed, but Python might fail at run time. The issue can be solved by installing the necessary dependencies and then re-installing Python.

错误修复#

直截了当的#

  • Bug in Categorical.fillna() that would replace all values, not just those that are NaN (GH26215)

类似日期的#

  • 窃听 to_datetime() 在那里通过一个时区-天真 DatetimeArrayDatetimeIndexutc=True 将错误地返回时区原始结果 (GH27733 )

  • Bug in Period.to_timestamp() where a Period outside the Timestamp implementation bounds (roughly 1677-09-21 to 2262-04-11) would return an incorrect Timestamp instead of raising OutOfBoundsDatetime (GH19643)

  • 迭代时出现错误 DatetimeIndex 当基础数据为只读时 (GH28055 )

时区#

  • Bug in Index where a numpy object array with a timezone aware Timestamp and np.nan would not return a DatetimeIndex (GH27011)

数字#

  • Bug in Series.interpolate() when using a timezone aware DatetimeIndex (GH27548)

  • Bug when printing negative floating point complex numbers would raise an IndexError (GH27484)

  • BUG在哪里 DataFrame 算术运算符,如 DataFrame.mul() 使用一个 Series 如果轴=1,则会引发 AttributeError 在……上面 DataFrame 大于调用数字表达式的最小阈值 (GH27636 )

  • Bug in DataFrame arithmetic where missing values in results were incorrectly masked with NaN instead of Inf (GH27464)

转换#

  • Improved the warnings for the deprecated methods Series.real() and Series.imag() (GH27610)

间隔#

  • Bug in IntervalIndex where dir(obj) would raise ValueError (GH27571)

标引#

  • Bug in partial-string indexing returning a NumPy array rather than a Series when indexing with a scalar like .loc['2015'] (GH27516)

  • 涉及的中断参考循环 Index 和其他索引类,以允许在不运行GC的情况下对索引对象进行垃圾收集。 (GH27585GH27840 )

  • 属性为DataFrame的单个列赋值的过程中修复回归问题 MultiIndex 列 (GH27841 )。

  • Fix regression in .ix fallback with an IntervalIndex (GH27865).

丢失#

IO#

  • 避免打电话 S3File.s3 在阅读拼花时,因为在s3fs版本0.3.0中删除了此功能 (GH27756 )

  • Better error message when a negative header is passed in pandas.read_csv() (GH27779)

  • 请遵循 min_rows 在笔记本的HTMLepr中正确显示选项(在v0.25.0中引入) (GH27991 )。

标绘#

分组依据/重采样/滚动#

重塑#

  • A KeyError ,则现在将引发 .unstack() 对象上调用 SeriesDataFrame 带着一套公寓 Index 传递的名称不正确 (GH18303 )

  • 虫虫 merge_asof() 无法合并 Timedelta 对象在传递时 tolerance 科瓦格 (GH27642 )

  • 窃听 DataFrame.crosstab() 什么时候 margins 设置为 Truenormalize 不是 False ,则会引发错误。 (GH27500 )

  • DataFrame.join() 现在会抑制 FutureWarning 当指定排序参数时 (GH21952 )

  • 窃听 DataFrame.join() 使用只读数组引发 (GH27943 )

稀疏#

  • 减少以下项目中的错误 Series 使用稀疏数据类型 (GH27080 )

其他#

  • 窃听 Series.replace()DataFrame.replace() 使用类似DICT的替换程序替换支持时区的时间戳时 (GH27720 )

  • 窃听 Series.rename() 使用自定义类型索引器时。现在,任何不可调用或类似于dict的值都被视为标量。 (GH27814 )

贡献者#

共有5人为此次发布贡献了补丁。名字中带有“+”的人第一次贡献了一个补丁。

  • Jeff Reback

  • Joris Van den Bossche

  • MeeseeksMachine +

  • Tom Augspurger

  • jbrockmendel