版本0.14.1(2014年7月11日)#
这是从0.14.0发布的一个小版本,包括少量的API更改、几个新功能、增强功能和性能改进,以及大量的错误修复。我们建议所有用户升级到此版本。
亮点包括:
新方法
select_dtypes()
根据数据类型和sem()
计算平均数的标准误差。支持Dateutil时区(请参见 docs )。
中忽略整行注释的支持
read_csv()
文本解析器。关于以下内容的新文档部分 Options and Settings 。
修复了很多错误。
API更改#
Openpyxl现在在构建Openpyxl编写器时引发ValueError,而不是对Pandas进口发出警告 (GH7284 )。
For
StringMethods.extract
, when no match is found, the result - only containingNaN
values - now also hasdtype=object
instead offloat
(GH7242)Period
对象不再引发TypeError
使用以下选项进行比较时==
使用另一个对象,该对象 不是吗 一个Period
。相反,在比较Period
使用另一个对象使用==
如果另一个对象不是Period
False
返回。 (GH7376 )以前,重置时间或不重置时间的行为
offsets.apply
,rollforward
和rollback
不同偏移量的操作有所不同。在世界银行的支持下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 nonnp.nan
value as this is inconsistent with a set-item expression likedf[mask] = None
(GH7656)
增强#
Add
dropna
argument tovalue_counts
andnunique
(GH5569).添加
select_dtypes()
允许基于数据类型选择列的方法 (GH7316 )。看见 the docs 。全
offsets
支持normalize
关键字来指定是否offsets.apply
,rollforward
和rollback
重置时间(小时、分钟等)或不重置(默认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 asDatetimeIndex
(GH7601)StringMethods
现在处理空系列 (GH7242 )文件解析器
read_csv
和read_table
现在忽略参数提供的行注释comment
,它只接受C读取器的单个字符。特别是,它们允许在文件数据开始之前进行注释 (GH2685 )添加
NotImplementedError
用于同时使用chunksize
和nrows
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 forSeries
,DataFrame
,Panel
, andGroupby
(GH6897)添加
nlargest
和nsmallest
发送到Series
groupby
Allowlist,这意味着您现在可以在SeriesGroupBy
对象 (GH7053 )。All offsets
apply
,rollforward
androllback
can now handlenp.datetime64
, previously results inApplyTypeError
(GH7452)Period
和PeriodIndex
可以包含NaT
在其价值上 (GH7485 )支持酸洗
Series
,DataFrame
和Panel
具有非唯一标签的对象 item 轴心 (index
,columns
和items
分别) (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 )
实验性的#
错误修复#
窃听
DataFrame.where
具有对称形状的框架和传递的DataFrame的另一个 (GH7506 )使用多索引轴的面板索引中出现错误 (GH7516 )
具有重复索引和非精确端点的类日期时间片索引中的回归 (GH7523 )
列表列表和单一VS混合类型的集合中存在错误 (GH7551 :)
非对齐系列中的时间错误操作 (GH7500 )
赋值不完整级数时时间增量推断中的错误 (GH7592 )
Groupby中的错误
.nth
具有系列和类似整数的列名 (GH7559 )窃听
Series.get
使用布尔访问器 (GH7407 )窃听
value_counts
哪里NaT
不符合失踪的条件 (NaN
) (GH7423 )Bug in line plot doesn't set correct
xlim
ifsecondary_y=True
(GH7459)分组中的错误
hist
和scatter
情节使用旧的figsize
默认设置 (GH7394 )使用绘制子图时出现错误
DataFrame.plot
,hist
已通过许可ax
即使次要情节的数量是一个 (GH7391 )。使用绘制子图时出现错误
DataFrame.boxplot
使用by
千瓦加薪ValueError
如果次要情节的数量超过1 (GH7391 )。子图显示中的错误
ticklabels
和labels
在不同的规则中 (GH5897 )窃听
Panel.apply
以多索引为轴 (GH7469 )Bug in
DatetimeIndex.insert
doesn't preservename
andtz
(GH7299)Bug in
DatetimeIndex.asobject
doesn't preservename
(GH7299)使用类似日期时间的范围(字符串和时间戳)进行多索引切片时出现错误, (GH7429 )
窃听
Index.min
和max
不能处理nan
和NaT
恰如其分 (GH7261 )Bug in
PeriodIndex.min/max
results inint
(GH7609)Bug in
resample
wherefill_method
was ignored if you passedhow
(GH2073)Bug in
TimeGrouper
doesn't exclude column specified bykey
(GH7227)窃听
DataFrame
和Series
Bar和Barh阴谋增加TypeError
什么时候bottom
和left
已指定关键字 (GH7226 )窃听
DataFrame.hist
加薪TypeError
当它包含非数字列时 (GH7277 )窃听
Index.delete
不会保留name
和freq
属性 (GH7302 )窃听
DataFrame.query()
/eval
其中带有@符号的本地字符串变量被视为尝试删除的临时变量 (GH7300 )。窃听
Float64Index
它不允许重复 (GH7149 )。窃听
DataFrame.replace()
在那里真实的价值观正在被取代 (GH7140 )。窃听
StringMethods.extract()
其中,单个匹配组系列赛将使用匹配者的名称而不是组名 (GH7313 )。Bug in
isnull()
whenmode.use_inf_as_null == True
where isnull wouldn't testTrue
when it encountered aninf
/-inf
(GH7315).对于东半球时区,INFERFERED_FREQ中的错误导致无错误 (GH7310 )
窃听
Easter
偏移量为负数时返回错误的日期 (GH7195 )广播中的错误与
.div
、整型数据类型和被零除 (GH7325 )窃听
CustomBusinessDay.apply
加薪NameError
什么时候np.datetime64
对象被传递 (GH7196 )窃听
MultiIndex.append
,concat
和pivot_table
不保留时区 (GH6606 )窃听
.loc
在单个-多个索引级(即不嵌套)上具有索引器列表 (GH7349 )窃听
Series.map
当映射具有不同长度的元组关键字的词典时 (GH7333 )全部错误
StringMethods
现在处理空系列 (GH7242 )修复委派
read_sql
至read_sql_query
当查询不包含‘SELECT’时 (GH7324 )。Bug where a string column name assignment to a
DataFrame
with aFloat64Index
raised aTypeError
during a call tonp.isnan
(GH7366).BUG在哪里
NDFrame.replace()
未正确将对象替换为Period
值 (GH7379 )。窃听
.ix
Getitem应始终返回一个序列 (GH7150 )使用不完整索引器的多索引切片中的错误 (GH7399 )
切片级别中的一个步骤的多索引切片中的错误 (GH7400 )
错误,其中负索引器位于
DatetimeIndex
没有正确切片 (GH7408 )Bug where
NaT
wasn't repr'd correctly in aMultiIndex
(GH7406, GH7409).Bug where bool objects were converted to
nan
inconvert_objects
(GH7416).窃听
quantile
忽略AXIS关键字参数 (GH7306 )BUG在哪里
nanops._maybe_null_out
不适用于复数 (GH7353 )BUG中的几个
nanops
在以下情况下的功能axis==0
对于一维nan
阵列 (GH7354 )Bug where
nanops.nanmedian
doesn't work whenaxis==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 offsetsapply
,rollforward
orrollback
resetstzinfo
or raisesValueError
(GH7465)Bug in
DatetimeIndex.to_period
,PeriodIndex.asobject
,PeriodIndex.to_timestamp
doesn't preservename
(GH7485)窃听
DatetimeIndex.to_period
和PeriodIndex.to_timestamp
手柄NaT
不正确 (GH7228 )Bug in
offsets.apply
,rollforward
androllback
may return normaldatetime
(GH7502)Bug in
resample
raisesValueError
when target containsNaT
(GH7227)窃听
Timestamp.tz_localize
重置nanosecond
信息 (GH7534 )Bug in
DatetimeIndex.asobject
raisesValueError
when it containsNaT
(GH7539)窃听
Timestamp.__new__
不能正确保存纳秒 (GH7610 )Bug in
Index.astype(float)
where it would return anobject
dtypeIndex
(GH7464).Bug in
DataFrame.reset_index
losestz
(GH3950)Bug in
DatetimeIndex.freqstr
raisesAttributeError
whenfreq
isNone
(GH7606)Bug in
GroupBy.size
created byTimeGrouper
raisesAttributeError
(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 timeseriesxlim
(GH3490)窃听
Float64Index
使用非标量索引器进行赋值 (GH7586 )Bug in
pandas.core.strings.str_contains
does not properly match in a case insensitive fashion whenregex=False
andcase=False
(GH7505)窃听
expanding_cov
,expanding_corr
,rolling_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 +