版本0.14.1(2014年7月11日)#

这是从0.14.0发布的一个小版本,包括少量的API更改、几个新功能、增强功能和性能改进,以及大量的错误修复。我们建议所有用户升级到此版本。

API更改#

  • Openpyxl现在在构建Openpyxl编写器时引发ValueError,而不是对Pandas进口发出警告 (GH7284 )。

  • For StringMethods.extract, when no match is found, the result - only containing NaN values - now also has dtype=object instead of float (GH7242)

  • Period 对象不再引发 TypeError 使用以下选项进行比较时 == 使用另一个对象,该对象 不是吗 一个 Period 。相反,在比较 Period 使用另一个对象使用 == 如果另一个对象不是 Period False 返回。 (GH7376 )

  • 以前,重置时间或不重置时间的行为 offsets.applyrollforwardrollback 不同偏移量的操作有所不同。在世界银行的支持下 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 TypeError on inplace-setting with a .where and a non np.nan value as this is inconsistent with a set-item expression like df[mask] = None (GH7656)

增强#

  • Add dropna argument to value_counts and nunique (GH5569).

  • 添加 select_dtypes() 允许基于数据类型选择列的方法 (GH7316 )。看见 the docs

  • offsets 支持 normalize 关键字来指定是否 offsets.applyrollforwardrollback 重置时间(小时、分钟等)或不重置(默认 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"))
    
  • PeriodIndex is represented as the same format as DatetimeIndex (GH7601)

  • StringMethods 现在处理空系列 (GH7242 )

  • 文件解析器 read_csvread_table 现在忽略参数提供的行注释 comment ,它只接受C读取器的单个字符。特别是,它们允许在文件数据开始之前进行注释 (GH2685 )

  • 添加 NotImplementedError 用于同时使用 chunksizenrows For 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 for Series, DataFrame, Panel, and Groupby (GH6897)

  • 添加 nlargestnsmallest 发送到 Series groupby Allowlist,这意味着您现在可以在 SeriesGroupBy 对象 (GH7053 )。

  • All offsets apply, rollforward and rollback can now handle np.datetime64, previously results in ApplyTypeError (GH7452)

  • PeriodPeriodIndex 可以包含 NaT 在其价值上 (GH7485 )

  • 支持酸洗 SeriesDataFramePanel 具有非唯一标签的对象 item 轴心 (indexcolumnsitems 分别) (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 )

实验性的#

  • pandas.io.data.Options has a new method, get_all_data method, and now consistently returns a MultiIndexed DataFrame (GH5602)

  • io.gbq.read_gbqio.gbq.to_gbq 进行了重构,以消除对Google的依赖 bq.py 命令行客户端。此子模块现在使用 httplib2 和谷歌 apiclientoauth2client API客户端库应该更稳定,因此比 bq.py 。看见 the docs 。 (GH6937 )。

错误修复#

  • 窃听 DataFrame.where 具有对称形状的框架和传递的DataFrame的另一个 (GH7506 )

  • 使用多索引轴的面板索引中出现错误 (GH7516 )

  • 具有重复索引和非精确端点的类日期时间片索引中的回归 (GH7523 )

  • 列表列表和单一VS混合类型的集合中存在错误 (GH7551 :)

  • 非对齐系列中的时间错误操作 (GH7500 )

  • 赋值不完整级数时时间增量推断中的错误 (GH7592 )

  • Groupby中的错误 .nth 具有系列和类似整数的列名 (GH7559 )

  • 窃听 Series.get 使用布尔访问器 (GH7407 )

  • 窃听 value_counts 哪里 NaT 不符合失踪的条件 (NaN ) (GH7423 )

  • 窃听 to_timedelta 接受无效单位并曲解‘m/h’ (GH7611GH6423 )

  • Bug in line plot doesn't set correct xlim if secondary_y=True (GH7459)

  • 分组中的错误 histscatter 情节使用旧的 figsize 默认设置 (GH7394 )

  • 使用绘制子图时出现错误 DataFrame.plothist 已通过许可 ax 即使次要情节的数量是一个 (GH7391 )。

  • 使用绘制子图时出现错误 DataFrame.boxplot 使用 by 千瓦加薪 ValueError 如果次要情节的数量超过1 (GH7391 )。

  • 子图显示中的错误 ticklabelslabels 在不同的规则中 (GH5897 )

  • 窃听 Panel.apply 以多索引为轴 (GH7469 )

  • Bug in DatetimeIndex.insert doesn't preserve name and tz (GH7299)

  • Bug in DatetimeIndex.asobject doesn't preserve name (GH7299)

  • 使用类似日期时间的范围(字符串和时间戳)进行多索引切片时出现错误, (GH7429 )

  • 窃听 Index.minmax 不能处理 nanNaT 恰如其分 (GH7261 )

  • Bug in PeriodIndex.min/max results in int (GH7609)

  • Bug in resample where fill_method was ignored if you passed how (GH2073)

  • Bug in TimeGrouper doesn't exclude column specified by key (GH7227)

  • 窃听 DataFrameSeries Bar和Barh阴谋增加 TypeError 什么时候 bottomleft 已指定关键字 (GH7226 )

  • 窃听 DataFrame.hist 加薪 TypeError 当它包含非数字列时 (GH7277 )

  • 窃听 Index.delete 不会保留 namefreq 属性 (GH7302 )

  • 窃听 DataFrame.query()/eval 其中带有@符号的本地字符串变量被视为尝试删除的临时变量 (GH7300 )。

  • 窃听 Float64Index 它不允许重复 (GH7149 )。

  • 窃听 DataFrame.replace() 在那里真实的价值观正在被取代 (GH7140 )。

  • 窃听 StringMethods.extract() 其中,单个匹配组系列赛将使用匹配者的名称而不是组名 (GH7313 )。

  • Bug in isnull() when mode.use_inf_as_null == True where isnull wouldn't test True when it encountered an inf/-inf (GH7315).

  • 对于东半球时区,INFERFERED_FREQ中的错误导致无错误 (GH7310 )

  • 窃听 Easter 偏移量为负数时返回错误的日期 (GH7195 )

  • 广播中的错误与 .div 、整型数据类型和被零除 (GH7325 )

  • 窃听 CustomBusinessDay.apply 加薪 NameError 什么时候 np.datetime64 对象被传递 (GH7196 )

  • 窃听 MultiIndex.appendconcatpivot_table 不保留时区 (GH6606 )

  • 窃听 .loc 在单个-多个索引级(即不嵌套)上具有索引器列表 (GH7349 )

  • 窃听 Series.map 当映射具有不同长度的元组关键字的词典时 (GH7333 )

  • 全部错误 StringMethods 现在处理空系列 (GH7242 )

  • 修复委派 read_sqlread_sql_query 当查询不包含‘SELECT’时 (GH7324 )。

  • Bug where a string column name assignment to a DataFrame with a Float64Index raised a TypeError during a call to np.isnan (GH7366).

  • BUG在哪里 NDFrame.replace() 未正确将对象替换为 Period 值 (GH7379 )。

  • 窃听 .ix Getitem应始终返回一个序列 (GH7150 )

  • 使用不完整索引器的多索引切片中的错误 (GH7399 )

  • 切片级别中的一个步骤的多索引切片中的错误 (GH7400 )

  • 错误,其中负索引器位于 DatetimeIndex 没有正确切片 (GH7408 )

  • Bug where NaT wasn't repr'd correctly in a MultiIndex (GH7406, GH7409).

  • Bug where bool objects were converted to nan in convert_objects (GH7416).

  • 窃听 quantile 忽略AXIS关键字参数 (GH7306 )

  • BUG在哪里 nanops._maybe_null_out 不适用于复数 (GH7353 )

  • BUG中的几个 nanops 在以下情况下的功能 axis==0 对于一维 nan 阵列 (GH7354 )

  • Bug where nanops.nanmedian doesn't work when axis==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 tzinfo to some offsets apply, rollforward or rollback resets tzinfo or raises ValueError (GH7465)

  • Bug in DatetimeIndex.to_period, PeriodIndex.asobject, PeriodIndex.to_timestamp doesn't preserve name (GH7485)

  • 窃听 DatetimeIndex.to_periodPeriodIndex.to_timestamp 手柄 NaT 不正确 (GH7228 )

  • Bug in offsets.apply, rollforward and rollback may return normal datetime (GH7502)

  • Bug in resample raises ValueError when target contains NaT (GH7227)

  • 窃听 Timestamp.tz_localize 重置 nanosecond 信息 (GH7534 )

  • Bug in DatetimeIndex.asobject raises ValueError when it contains NaT (GH7539)

  • 窃听 Timestamp.__new__ 不能正确保存纳秒 (GH7610 )

  • Bug in Index.astype(float) where it would return an object dtype Index (GH7464).

  • Bug in DataFrame.reset_index loses tz (GH3950)

  • Bug in DatetimeIndex.freqstr raises AttributeError when freq is None (GH7606)

  • Bug in GroupBy.size created by TimeGrouper raises AttributeError (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_y axis not being considered for timeseries xlim (GH3490)

  • 窃听 Float64Index 使用非标量索引器进行赋值 (GH7586 )

  • Bug in pandas.core.strings.str_contains does not properly match in a case insensitive fashion when regex=False and case=False (GH7505)

  • 窃听 expanding_covexpanding_corrrolling_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 +