1.4.3 版本更新(2022 年 6 月 23 日)#
這是 pandas 1.4.3 版本中的更改。有關包含其他 pandas 版本的完整更改日誌,請參閱 釋出說明。
使用空或全為 NA 的 DataFrame 列時的 concat 行為#
1.4.0 版本中停止忽略 concat() 中具有浮點數或物件 dtype 的空或全為 NA 列的資料型別的行為更改(忽略 concat 中具有空或全為 NA 列的 dtype)已被恢復(GH 45637)。
修復的迴歸#
修復了
DataFrame.replace()中的迴歸問題,當替換值在字典中作為to_replace傳遞時顯式為None,這還會將其他列強制轉換為 object dtype,即使沒有要替換的值(GH 46634)。修復了
DataFrame.to_csv()中當DataFrame包含擴充套件 dtype 分類列時引發錯誤(GH 46297,GH 46812)。修復了
MultiIndex的dtypes屬性表示中的迴歸問題(GH 46900)。修復了使用
DataFrame.loc()設定值時更新RangeIndex的迴歸問題,當索引被設定為新列並且之後該列被更新時(GH 47128)。修復了
DataFrame.fillna()和DataFrame.update()在原地更新時建立副本的迴歸問題(GH 47188)。修復了
DataFrame.nsmallest()中排序列包含np.nan值時導致結果不正確的迴歸問題(GH 46589)。修復了
read_fwf()在指定widths和usecols時引發ValueError的迴歸問題(GH 46580)。修復了
Groupby.transform()和Groupby.agg()在使用engine="numba"且索引為MultiIndex時失敗的迴歸問題(GH 46867)。修復了
Styler.to_latex()和Styler.to_html()中buf與encoding組合使用時失敗的迴歸問題(GH 47053)。修復了
read_csv()在index_col=False和header=None時將第一行識別為索引名稱的迴歸問題(GH 46955)。修復了
DataFrameGroupBy.agg()在與 list-likes 或 dict-likes 結合使用axis=1時會給出錯誤結果的迴歸問題;現在引發NotImplementedError(GH 46995)。修復了
DataFrame.resample()和DataFrame.rolling()在與 list-likes 或 dict-likes 結合使用axis=1時引發非直觀錯誤訊息的迴歸問題;現在引發NotImplementedError(GH 46904)。修復了
testing.assert_index_equal()中當check_order=False且Index具有擴充套件或物件 dtype 時的迴歸問題(GH 47207)。修復了
read_excel()在某些輸入工作表中將 int 返回為 float 的迴歸問題(GH 46988)。修復了
DataFrame.shift()中當axis為columns且fill_value缺失時,freq被忽略的迴歸問題(GH 47039)。修復了
DataFrame.to_json()中,當DataFrame使用PeriodIndex型別的index引數建立時導致分段違規的迴歸問題(GH 46683)。
Bug 修復#
修復了
pandas.eval()、DataFrame.eval()和DataFrame.query()中,傳遞空的local_dict或global_dict被視為傳遞None的錯誤(GH 47084)。大多數 I/O 方法在關閉檔案控制代碼時不再抑制
OSError和ValueError(GH 47136)。改進了
DataFrame.from_dict()在傳遞無效orient引數時引發的錯誤訊息(GH 47450)。
其他#
編譯 pandas 所需的 Cython 的最低版本現為
0.29.30(GH 41935)。
貢獻者#
共有 18 人為本次釋出貢獻了補丁。名字旁有“+”號的人是首次貢獻補丁。
Alex-Blade +
Andrew Hawyrluk
JHM Darbyshire
Jeff Reback
Joris Van den Bossche
Marc Garcia
Marco Edward Gorelli
Matthew Roeschke
MeeseeksMachine
Pandas Development Team
Patrick Hoefler
Richard Shadrach
Robert de Vries
Simon Hawkins
Thomas Li
Tim Swast
Wenjun Si
Yuanhao Geng