3.0.0 中的新功能 (2026 年 1 月 21 日)#

這些是 pandas 3.0.0 中的更改。有關包括其他 pandas 版本在內的完整變更日誌,請參閱釋出說明

注意

pandas 3.0 版本刪除了許多在先前版本中已棄用的功能(有關概述,請參閱下方)。建議在升級到 pandas 3.0 之前,首先升級到 pandas 2.3 並確保您的程式碼在沒有警告的情況下正常執行。

增強功能#

預設使用專用的字串資料型別#

歷史上,pandas 使用 NumPy 的 object 資料型別來表示字串列。這種表示方法存在許多問題:它不專門用於字串(object 型別的陣列可以儲存任何 Python 物件,而不僅僅是字串),而且通常效率不高(在效能和記憶體使用方面)。

從 pandas 3.0 開始,預設啟用專用的字串資料型別(底層由 PyArrow 支援,如果已安裝;否則,回退到由 NumPy object 型別支援)。這意味著 pandas 在建立 pandas 物件(例如在建構函式或 I/O 函式中)時,將開始將包含字串資料的列推斷為新的 str 資料型別。

舊行為

>>> ser = pd.Series(["a", "b"])
0    a
1    b
dtype: object

新行為

>>> ser = pd.Series(["a", "b"])
0    a
1    b
dtype: str

在這些場景中使用的字串資料型別在很大程度上將表現得像 NumPy object 一樣,包括缺失值語義和這些列上的通用操作。

新字串資料型別的主要特性

  • 預設推斷字串資料(而不是 object 型別)

  • object 型別不同,str 型別只能包含字串(或缺失值)。(用非字串進行 setitem 會失敗)

  • 缺失值標記始終是 NaNnp.nan),並且遵循與其他預設資料型別相同的缺失值語義。

這些有意進行的更改可能導致破壞性後果,例如在檢查 .dtype 是否為 object 型別或檢查確切的缺失值標記時。有關行為更改的更多詳細資訊以及如何使您的程式碼適應新的預設設定,請參閱新字串資料型別遷移指南(pandas 3.0)

Copy-on-Write 的一致複製/檢視行為#

pandas 3.0 中的新“Copy-on-Write”行為在 pandas 處理複製和檢視的方式上帶來了行為上的改變。變更摘要

  1. 任何索引操作(以任何方式子集化 DataFrame 或 Series,即包括將 DataFrame 列作為 Series 訪問)或返回新的 DataFrame 或 Series 的任何方法的結果,在使用者 API 方面始終表現得像是複製。

  2. 因此,如果您想修改一個物件(DataFrame 或 Series),唯一的方法是直接修改該物件本身。

此更改的主要目標是使使用者 API 更加一致和可預測。現在有一個明確的規則:任何子集或返回的 Series/DataFrame 始終表現為原始物件的副本,因此永遠不會修改原始物件(在 pandas 3.0 之前,派生物件是副本還是檢視取決於執行的確切操作,這常常令人困惑)。

由於每個索引步驟現在都表現為副本,這也意味著“鏈式賦值”(透過多個 setitem 步驟更新 DataFrame)將停止工作。由於這現在始終無效,因此移除了 SettingWithCopyWarning,並且不再需要防禦性地呼叫 .copy() 來抑制警告。

新行為語義在關於 Copy-on-Write 的使用者指南中有更詳細的解釋。

次要目標是透過避免不必要的複製來提高效能。如上所述,從索引操作或方法返回的每個新的 DataFrame 或 Series 都表現為副本,但在底層,pandas 會盡可能使用檢視,僅在需要保證“表現為副本”的行為時才複製(這是實際使用的“Copy-on-Write”機制作為實現細節)。

上述某些行為更改是 pandas 3.0 中的破壞性更改。升級到 pandas 3.0 時,建議首先升級到 pandas 2.3,以獲取這些更改子集的一些棄用警告。遷移指南更詳細地解釋了升級過程。

設定 mode.copy_on_write 選項不再有任何影響。該選項已被棄用,將在 pandas 4.0 中刪除。

初步支援使用 pd.col() 語法建立表示式#

此版本引入了 col(),用於按名稱引用 DataFrame 列並構建表示式。

這可以用作一種簡化的語法,用於建立可呼叫物件,供 DataFrame.assign() 等方法使用。實際上,以前需要使用 lambda 函式的地方,現在可以使用 pd.col() 代替。

例如,如果您有一個 DataFrame

In [1]: df = pd.DataFrame({'a': [1, 1, 2], 'b': [4, 5, 6]})

並且您想透過對 'a''b' 求和來建立一個新列 'c',那麼與使用

In [2]: df.assign(c = lambda df: df['a'] + df['b'])
Out[2]: 
   a  b  c
0  1  4  5
1  1  5  6
2  2  6  8

您現在可以這樣寫

In [3]: df.assign(c = pd.col('a') + pd.col('b'))
Out[3]: 
   a  b  c
0  1  4  5
1  1  5  6
2  2  6  8

col() 返回的表示式物件支援所有標準運算子(如 +-*/ 等)以及所有 Series 方法和名稱空間(如 pd.col("name").sum()pd.col("name").str.upper() 等)。

目前,pd.col() 語法可以用於接受一個可呼叫物件(該物件將呼叫它的 DataFrame 作為第一個引數並返回一個 Series)的任何地方,例如 lambda df: df[col_name]。這包括 DataFrame.assign()DataFrame.loc(),以及 getitem/setitem。

預計在未來的版本中,pd.col() 的支援將擴充套件到更多方法。

支援 Arrow PyCapsule 介面#

Arrow C 資料介面允許透過 Arrow 格式在不同 DataFrame 庫之間移動資料,並且儘可能設計為零複製。在 Python 中,該介面透過 Arrow PyCapsule 協議公開。

DataFrameSeries 現在支援 Arrow PyCapsule 介面,用於資料的匯出和匯入(GH 56587GH 63208GH 59518GH 59631)。

添加了專用的 DataFrame.from_arrow()Series.from_arrow() 方法,用於透過該介面將任何 Arrow 相容的資料物件匯入 pandas 物件。

對於匯出,DataFrameSeries 實現 C 流介面(__arrow_c_stream__)方法。

這些方法目前依賴 pyarrow 將表格物件轉換為 Arrow 格式或從 Arrow 格式轉換為 pandas。

更新的棄用策略#

pandas 3.0.0 更新了棄用策略,使用新的 3 階段策略來明確將發出哪些棄用警告:首先使用 DeprecationWarning,然後在下一個主要版本之前的最後一個次要版本中切換到 FutureWarning 以獲得更廣泛的可見性,然後在主要版本中刪除已棄用的功能。這樣做的目的是為下游包提供更多時間來適應 pandas 的棄用,這應該會減少使用者從非自己程式碼中收到的警告數量。有關更多詳細資訊,請參閱PDEP 17

pandas 中即將發生的所有更改的警告都將具有基類 pandas.errors.PandasChangeWarning。使用者還可以使用以下子類來控制警告。

在 3.x 中使用 pandas.errors.Pandas4Warning 新增的棄用將最初繼承自 pandas.errors.PandasDeprecationWarning。在 3.x 系列的最後一個次要版本中,這些棄用將切換為繼承自 pandas.errors.PandasFutureWarning,以獲得更廣泛的可見性。

其他增強功能#

I/O

  • 改進了 errors.DtypeWarning,在檢測到混合資料型別時包含列名(GH 58174

  • DataFrame.to_excel() 中,merge_cells 引數現在接受值 "columns",僅合併 MultiIndex 列標題單元格(GH 35384

  • DataFrame.to_excel() 有一個新的 autofilter 引數,用於為所有列新增自動過濾器(GH 61194

  • 當單元格中的字元數超過 Excel 的 32767 個字元限制時,DataFrame.to_excel() 現在會引發 UserWarningGH 56954

  • read_parquet() 接受 to_pandas_kwargs,它會被轉發到 pyarrow.Table.to_pandas(),這使得可以傳遞額外的關鍵字引數來自定義轉換為 pandas 的過程,例如使用 maps_as_pydicts 將 Parquet 對映資料型別讀取為 Python 字典(GH 56842

  • read_spss() 現在支援將 kwargs 傳遞給 pyreadstatGH 56356

  • read_stata() 現在返回的 datetime64 解析度能更好地匹配 Stata 格式中原生儲存的解析度(GH 55642

  • DataFrame.to_csv()Series.to_csv() 現在除了 % 格式字串和可呼叫物件之外,還支援 f-string(例如 "{:.6f}")用於 float_format 引數(GH 49580

  • DataFrame.to_json() 現在將 Decimal 編碼為字串而不是浮點數(GH 60698

  • DataFrame.to_sql()if_exists 引數中添加了 "delete_rows" 選項,在插入資料之前刪除表中的所有記錄(GH 37210)。

  • 使用新的 read_iceberg()DataFrame.to_iceberg() 函式,添加了與 Apache Iceberg 表進行讀寫支援(GH 61383

  • SQL I/O 期間發生的錯誤現在將丟擲通用 DatabaseError,而不是來自底層驅動程式管理器庫的原始 Exception 型別(GH 60748

  • 恢復了對讀取 Stata 104 格式的支援,並啟用了對 103 格式 dta 檔案的讀取(GH 58554

  • 支援讀取 Stata 102 格式(Stata 1)dta 檔案(GH 58978

  • 支援讀取 Stata 110 格式(Stata 7)dta 檔案(GH 47176

  • 支援從 Stata 108 格式(Stata 6)及更早的檔案中讀取值標籤(GH 58154

Groupby/resample/rolling

Reshaping

Missing

  • DataFrame.fillna()Series.fillna() 現在可以接受 value=None;對於非物件 dtype,將使用相應的 NA 值(GH 57723

  • DataFrame.fillna() 中,添加了對 axis=1dictSeries 引數的支援(GH 4514

數值

  • DataFrame.agg() 使用 axis=1 和一個會重新標記結果索引的 func 呼叫時,現在會引發 NotImplementedErrorGH 58807)。

  • DataFrame.corrwith() 現在接受 min_periods 作為可選引數,與 DataFrame.corr()Series.corr() 相同(GH 9490

  • DataFrame.cummin(), DataFrame.cummax(), DataFrame.cumprod()DataFrame.cumsum() 方法現在有一個 numeric_only 引數(GH 53072

  • DataFrame.ewm() 現在在提供 times 時允許 adjust=FalseGH 54328

  • Series.cummin()Series.cummax() 現在支援 CategoricalDtypeGH 52335

  • Series.map() 現在可以接受 kwargs 來傳遞給 func(GH 59814

  • Series.nlargest() 在內部使用穩定排序,在相等的情況下會保留原始順序(GH 55767

  • Series.round() 現在支援物件 dtype,前提是底層 Python 物件實現了 __round__GH 63444

  • 支援將 Iterable[Hashable] 輸入傳遞給 DataFrame.drop_duplicates()GH 59237

字串

Datetimelike

  • Easter 獲得了一個新的建構函式引數 method,它指定了用於計算復活節的方法,例如東正教復活節(GH 61665

  • Holiday 建構函式引數 days_of_week 在型別不是 Nonetuple 時將引發 ValueErrorGH 61658

  • Holiday 獲得了建構函式引數和欄位 exclude_dates,用於從自定義假日日曆中排除特定的日期時間(GH 54382

  • 添加了半年度偏移類 HalfYearBeginHalfYearEndBHalfYearBeginBHalfYearEndGH 60928

  • 改進了偏移量別名的棄用訊息(GH 60820

  • 將兩個 DateOffset 物件相乘現在將引發 TypeError 而不是 RecursionErrorGH 59442

索引

  • DataFrame.iloc()Series.iloc()__getitem__ 中現在支援布林掩碼,以實現更一致的索引行為(GH 60994

  • Index.get_loc() 現在也接受 tuple 的子類作為鍵(GH 57922

Styler / 輸出格式

  • Styler.set_tooltips() 提供了一種替代方法來儲存工具提示,透過使用 td 元素的 title 屬性。(GH 56981

  • 添加了 Styler.to_typst(),用於將 Styler 物件寫入 Typst 格式的檔案、緩衝區或字串(GH 57617

  • Styler.format_index_names() 現在可用於格式化索引和列名(GH 48936GH 47489

  • pandas 物件中的 frozenset 元素現在可以本機列印(GH 60690

型別提示

繪圖

ExtensionArray

  • ArrowDtype 現在支援 pyarrow.JsonTypeGH 60958

  • 使用 numpy 可空 dtype 的 Series.rank()DataFrame.rank() 會保留 NA 值,並在適當的時候返回 UInt64 dtype,而不是將 NA 轉換為 float64 dtype 的 NaNGH 62043

  • 改進了 DataFrame.where()DataFrame.mask() 在使用 ExtensionDtype other 時的結果 dtype(GH 62038

其他

  • set_option() 現在接受一個選項字典,從而簡化了多個設定的同時配置(GH 61093

  • DataFrame.apply() 支援使用第三方執行引擎,如 Bodo.ai JIT 編譯器(GH 60668

  • Series.map() 現在接受一個 engine 引數,以允許使用第三方執行引擎進行執行(GH 61125

  • 支援將 Series 輸入傳遞給 json_normalize(),並保留 IndexGH 51452

  • 使用者可以透過將選項 mode.performance_warnings 設定為 False 來全域性停用任何 PerformanceWarningGH 56920

打包

  • wheels.yml 中,將 wheel 上傳切換為 **PyPI 可信釋出** (OIDC),以進行 release-tag 推送。(GH 61718

  • 現在 Windows ARM64 架構也提供了 wheels(GH 61462

  • 現在 Windows 上的 free-threading Python 構建也提供了 wheels(除其他平臺外)(GH 61463

重要的 bug 修復#

這些 bug 修復可能帶來行為上的顯著變化。

改進了 groupby 中 observed=False 的行為#

透過改進對未觀察到的組的處理,修復了許多錯誤。本節中的所有說明都同樣影響 SeriesGroupBy。(GH 55738

在 pandas 的先前版本中,使用 DataFrameGroupBy.apply()DataFrameGroupBy.agg() 進行單次分組會將未觀察到的組傳遞給提供的函式,從而正確得到下方的 0

In [4]: df = pd.DataFrame(
   ...:     {
   ...:         "key1": pd.Categorical(list("aabb"), categories=list("abc")),
   ...:         "key2": [1, 1, 1, 2],
   ...:         "values": [1, 2, 3, 4],
   ...:     }
   ...: )
   ...: 

In [5]: df
Out[5]: 
  key1  key2  values
0    a     1       1
1    a     1       2
2    b     1       3
3    b     2       4

In [6]: gb = df.groupby("key1", observed=False)

In [7]: gb[["values"]].apply(lambda x: x.sum())
Out[7]: 
      values
key1        
a          3
b          7
c          0

然而,在使用多重分組時,情況並非如此,會導致下方的 NaN

In [1]: gb = df.groupby(["key1", "key2"], observed=False)
In [2]: gb[["values"]].apply(lambda x: x.sum())
Out[2]:
           values
key1 key2
a    1        3.0
     2        NaN
b    1        3.0
     2        4.0
c    1        NaN
     2        NaN

現在,使用多重分組也會將未觀察到的組傳遞給提供的函式。

In [8]: gb = df.groupby(["key1", "key2"], observed=False)

In [9]: gb[["values"]].apply(lambda x: x.sum())
Out[9]: 
           values
key1 key2        
a    1          3
     2          0
b    1          3
     2          4
c    1          0
     2          0

同樣

這些改進也修復了 groupby 中的某些錯誤

  • 當存在多重分組、未觀察到的組且 as_index=False 時,DataFrameGroupBy.agg() 會失敗(GH 36698

  • sort=False 時,DataFrameGroupBy.groups() 會對組進行排序;現在它們將按照觀察到的順序出現(GH 56966

  • 當存在多重分組、未觀察到的組且 as_index=False 時,DataFrameGroupBy.nunique() 會失敗(GH 52848

  • 當存在多重分組、未觀察到的組且存在非數字資料時,DataFrameGroupBy.sum() 的值不正確(GH 43891

  • 當使用部分分類和部分非分類分組以及 observed=False 時,DataFrameGroupBy.value_counts() 會產生不正確的結果(GH 56016

向後不相容的 API 更改#

日期時間/時間差解析度推斷#

在 pandas 3.0 之前,每當將字串序列、標準庫 datetime 物件、np.datetime64 物件或整數轉換為 datetime64 / timedelta64 dtype 時,這總是會導致納秒解析度(或因超出範圍而引發錯誤)。現在,它會對適當的解析度(也稱為 unit)進行推斷,用於輸出 dtype。這會影響通用建構函式(SeriesDataFrameIndexDatetimeIndex)以及特定的轉換或建立函式(to_datetime()to_timedelta()date_range()timedelta_range()TimestampTimedelta)。

各種輸入型別的通用規則

  • 解析字串時的預設新解析度為微秒,當字串的精度需要時,會回退到納秒。

  • 對於標準庫 datetime 物件(即微秒)或 np.datetime64/np.timedelta64 物件(即單位,最多支援到秒到納秒的範圍),輸入的解析度會被保留。

  • 對於整數輸入,解析整數值的方式被用作結果解析度(或被限制在支援的秒到納秒範圍內)。

例如,以下在以前總是會給出納秒解析度,但現在會推斷

# parsing strings
In [10]: print(pd.to_datetime(["2024-03-22 11:36"]).dtype)
datetime64[us]

# converting integers
In [11]: print(pd.to_datetime([0], unit="s").dtype)
datetime64[s]

# converting stdlib datetime object
In [12]: dt = pd.Timestamp("2024-03-22 11:36").to_pydatetime()

In [13]: print(pd.to_datetime([dt]).dtype)
datetime64[us]

# the same when inferring a datetime dtype in the generic constructors
In [14]: print(pd.Series([dt]).dtype)
datetime64[us]

# converting numpy objects
In [15]: print(pd.Series([np.datetime64("2024-03-22", "ms")]).dtype)
datetime64[ms]

當傳入一系列 np.datetime64 物件時,也會有類似的情況,傳入物件的解析度將被保留(或者對於低於秒的解析度,將使用秒解析度)。

解析字串時,預設現在是微秒(這也影響從文字檔案讀取的 I/O 方法,例如 read_csv()read_json())。除非字串具有納秒精度,在這種情況下將使用納秒解析度。

In [16]: print(pd.to_datetime(["2024-03-22 11:43:01.123"]).dtype)
datetime64[us]

In [17]: print(pd.to_datetime(["2024-03-22 11:43:01.123456"]).dtype)
datetime64[us]

In [18]: print(pd.to_datetime(["2024-03-22 11:43:01.123456789"]).dtype)
datetime64[ns]

對於帶有字串輸入的 Timestamp 建構函式來說,這也有一個變化,在版本 2.x.y 中,這可能會給出秒或毫秒單位(GH 52653)。

警告

許多使用者現在將在他們以前得到“datetime64[ns]”資料型別的情況下得到“datetime64[us]”資料型別。對於大多數用例,他們應該不會注意到差異。一個大的例外是將它們轉換為整數,這將得到小 1000 倍的整數。

當將日期時間類資料轉換為整數時,建議避免使用 astype("int64") 以使程式碼不依賴於確切的單位,或者在轉換之前確保所需的單位,使用 as_unit()

有關更多詳細資訊,請參閱 從時間戳到 epoch

concat() 不再忽略 sort 引數,當所有物件都有 DatetimeIndex#

當傳遞給 concat() 的所有物件都具有 DatetimeIndex 時,傳遞 sort=False 現在將導致非連線軸不排序。以前,即使傳遞了 sort=False,結果也會沿著非連線軸排序。(GH 57335

如果您不指定 sort 引數,pandas 將繼續返回排序結果,但此行為已被棄用,您將收到警告。為了減少對使用者的干擾,pandas 會檢查不排序是否會影響結果,並且僅在會影響時發出警告。此檢查可能很耗時,使用者可以透過顯式指定 sort=Truesort=False 來跳過此檢查。

此棄用也可能影響 pandas 對 concat() 的內部使用。以下是 concat()DatetimeIndex 進行排序但不對其他索引進行排序的情況,這些情況被視為錯誤並已按如下方式修復。但仍有可能遺漏一些。為了謹慎起見,pandas 在我們認為行為不應改變的任何內部呼叫中新增 sort=False。如果我們遺漏了什麼,使用者將不會體驗到行為改變,但他們將收到關於 concat() 的警告,儘管他們沒有直接呼叫此函式。如果發生這種情況,我們要求使用者提出問題,以便我們解決任何潛在的行為變更。

In [19]: idx1 = pd.date_range("2025-01-02", periods=3, freq="h")

In [20]: df1 = pd.DataFrame({"a": [1, 2, 3]}, index=idx1)

In [21]: df1
Out[21]: 
                     a
2025-01-02 00:00:00  1
2025-01-02 01:00:00  2
2025-01-02 02:00:00  3

In [22]: idx2 = pd.date_range("2025-01-01", periods=3, freq="h")

In [23]: df2 = pd.DataFrame({"b": [1, 2, 3]}, index=idx2)

In [24]: df2
Out[24]: 
                     b
2025-01-01 00:00:00  1
2025-01-01 01:00:00  2
2025-01-01 02:00:00  3

舊行為

In [3]: pd.concat([df1, df2], axis=1, sort=False)
Out[3]:
                       a    b
2025-01-01 00:00:00  NaN  1.0
2025-01-01 01:00:00  NaN  2.0
2025-01-01 02:00:00  NaN  3.0
2025-01-02 00:00:00  1.0  NaN
2025-01-02 01:00:00  2.0  NaN
2025-01-02 02:00:00  3.0  NaN

新行為

In [25]: pd.concat([df1, df2], axis=1, sort=False)
Out[25]: 
                       a    b
2025-01-02 00:00:00  1.0  NaN
2025-01-02 01:00:00  2.0  NaN
2025-01-02 02:00:00  3.0  NaN
2025-01-01 00:00:00  NaN  1.0
2025-01-01 01:00:00  NaN  2.0
2025-01-01 02:00:00  NaN  3.0

在此版本中修復的 pandas 內部使用 concat() 導致不一致排序的情況如下。

DataFrame.value_counts()DataFrameGroupBy.value_counts() 中,當 sort=False 時行為已更改#

在 pandas 的先前版本中,DataFrame.value_counts()sort=False 會按行標籤對結果進行排序(如文件所述)。這不符合直覺,並且與 Series.value_counts() 保持輸入順序的行為不一致。現在 DataFrame.value_counts() 將保持輸入順序。(GH 59745

In [26]: df = pd.DataFrame(
   ....:     {
   ....:         "a": [2, 2, 2, 2, 1, 1, 1, 1],
   ....:         "b": [2, 1, 3, 1, 2, 3, 1, 1],
   ....:     }
   ....: )
   ....: 

In [27]: df
Out[27]: 
   a  b
0  2  2
1  2  1
2  2  3
3  2  1
4  1  2
5  1  3
6  1  1
7  1  1

舊行為

In [3]: df.value_counts(sort=False)
Out[3]:
a  b
1  1    2
   2    1
   3    1
2  1    2
   2    1
   3    1
Name: count, dtype: int64

新行為

In [28]: df.value_counts(sort=False)
Out[28]: 
a  b
2  2    1
   1    2
   3    1
1  2    1
   3    1
   1    2
Name: count, dtype: int64

此更改也適用於 DataFrameGroupBy.value_counts()。這裡有兩種排序選項:一種是傳遞給 DataFrame.groupby()sort,另一種是直接傳遞給 DataFrameGroupBy.value_counts()。前者決定是否對組進行排序,後者決定是否對計數進行排序。所有非分組列將在組內保持輸入順序。

舊行為

In [5]: df.groupby("a", sort=True).value_counts(sort=False)
Out[5]:
a  b
1  1    2
   2    1
   3    1
2  1    2
   2    1
   3    1
dtype: int64

新行為

In [29]: df.groupby("a", sort=True).value_counts(sort=False)
Out[29]: 
a  b
1  2    1
   3    1
   1    2
2  2    1
   3    1
   1    2
Name: count, dtype: int64

改變了 pd.offsets.Day 的行為,使其始終表示日曆日#

在 pandas 的先前版本中,offsets.Day 表示固定的 24 小時跨度,不考慮夏令時轉換。它現在始終表現為日曆日,在夏令時轉換期間保留一天中的時間。(GH 61985

舊行為

In [5]: ts = pd.Timestamp("2025-03-08 08:00", tz="US/Eastern")
In [6]: ts + pd.offsets.Day(1)
Out[3]: Timestamp('2025-03-09 09:00:00-0400', tz='US/Eastern')

新行為

In [30]: ts = pd.Timestamp("2025-03-08 08:00", tz="US/Eastern")

In [31]: ts + pd.offsets.Day(1)
Out[31]: Timestamp('2025-03-09 08:00:00-0400', tz='US/Eastern')

此更改修復了 date_range() 中的一個長期存在的錯誤(GH 51716GH 35388),但作為附帶結果導致了幾個小的行為差異。

  • pd.offsets.Day(n) 不再與 pd.offsets.Hour(24*n) 相等。

  • offsets.Day 不再支援除法。

  • Timedelta 不再接受 Day 物件作為輸入。

  • tseries.frequencies.to_offset()Timedelta 物件上,在以前返回 Day 物件的情況下,現在返回 offsets.Hour 物件。

  • 向帶有 Day freq 的時區感知 DatetimeIndex 新增或減去一個標量,不再保留該 freq 屬性。

  • 新增或減去一個帶 TimedeltaDay 不再受支援。

  • 向時區感知 Timestamp 或類似日期時間物件新增或減去一個 Day 偏移量,可能會導致歧義或不存在的時間,這將引發錯誤。

改變了 pyarrow 和 numpy 可空浮點 dtype 中 NaN 值的處理方式#

以前,在處理可空 dtype(例如 Float64Dtypeint64[pyarrow])時,NaN 在某些情況下被視為與 NA 可互換,但在其他情況下則不然。這是為了便於採用,但導致了一些混淆(GH 32265)。在 3.0 中,這種行為透過預設情況下在所有情況下將 NaN 視為等同於 NA 來實現一致性。

預設情況下,NaN 可以傳遞給建構函式、__setitem____contains__,並且將被視為與 NA 相同。使用者唯一會看到的變化是,以前引入 NaN 條目的算術和 np.ufunc 操作現在會產生 NA 條目。

舊行為

# NaN in input gets converted to NA
In [1]: ser = pd.Series([0, np.nan], dtype=pd.Float64Dtype())
In [2]: ser
Out[2]:
0     0.0
1    <NA>
dtype: Float64
# NaN produced by arithmetic (0/0) remained NaN
In [3]: ser / 0
Out[3]:
0     NaN
1    <NA>
dtype: Float64
# the NaN value is not considered as missing
In [4]: (ser / 0).isna()
Out[4]:
0    False
1     True
dtype: bool

新行為

In [32]: ser = pd.Series([0, np.nan], dtype=pd.Float64Dtype())

In [33]: ser
Out[33]: 
0     0.0
1    <NA>
dtype: Float64

In [34]: ser / 0
Out[34]: 
0    <NA>
1    <NA>
dtype: Float64

In [35]: (ser / 0).isna()
Out[35]: 
0    True
1    True
dtype: bool

將來,打算將 NaNNA 視為不同的值,並且在 3.0 中透過 pd.options.future.distinguish_nan_and_na 選項添加了一個控制此行為的選項。啟用後,NaN 始終被視為不同,特別是作為浮點值。因此,它不能與整數 dtype 一起使用。

舊行為

In [2]: ser = pd.Series([1, np.nan], dtype=pd.Float64Dtype())
In [3]: ser[1]
Out[3]: <NA>

新行為

In [36]: with pd.option_context("future.distinguish_nan_and_na", True):
   ....:     ser = pd.Series([1, np.nan], dtype=pd.Float64Dtype())
   ....:     print(ser[1])
   ....: 
nan

如果我們為後者示例中的 dtype 傳遞了 pd.Int64Dtype()"int64[pyarrow]",這將引發錯誤,因為浮點 NaN 不能由整數 dtype 儲存。

當啟用 "future.distinguish_nan_and_na" 時,ser.to_numpy()(以及 frame.valuesnp.asarray(obj))將在存在 NA 條目時轉換為 object dtype,而以前它們會強制轉換為 NaN。要保留浮點 numpy dtype,請顯式將 na_value=np.nan 傳遞給 Series.to_numpy()

請注意,該選項是實驗性的,可能在未來的版本中發生變化。

__module__ 屬性現在指向公共模組#

公共 API 中函式和類的 __module__ 屬性已更新,以指向訪問該物件的首選公共模組,而不是該物件碰巧定義的模組(GH 55178)。

這在 Python 控制檯中產生更具資訊量的類顯示,例如,不是 <class 'pandas.core.frame.DataFrame'>,而是看到 <class 'pandas.DataFrame'>,以及在 IPython 等互動式工具中,例如,不是 <function pandas.io.parsers.readers.read_csv(...)>,而是看到 <function pandas.read_csv(...)>

這可能會破壞依賴於先前 __module__ 值的程式碼(例如,檢查 DataFrame 物件 type() 的 doctest)。

提高了 Python 的最低版本要求#

pandas 3.0.0 支援 Python 3.11 及更高版本。

提高了依賴項的最低版本#

一些最低支援的依賴版本已更新。以下必需的依賴項已更新:

新最低版本

numpy

1.26.0

對於可選庫,一般建議使用最新版本。下表列出了在 pandas 開發過程中始終進行測試的每個庫的最低版本。低於最低測試版本的可選庫可能仍然有效,但未被視為受支援。

新最低版本

adbc-driver-postgresql

1.2.0

adbc-driver-sqlite

1.2.0

mypy (dev)

1.9.0

beautifulsoup4

4.12.3

bottleneck

1.4.2

fastparquet

2024.11.0

fsspec

2024.10.0

hypothesis

6.116.0

gcsfs

2024.10.0

Jinja2

3.1.5

lxml

5.3.0

Jinja2

3.1.3

matplotlib

3.9.3

numba

0.60.0

numexpr

2.10.2

qtpy

2.4.2

openpyxl

3.1.5

psycopg2

2.9.10

pyarrow

13.0.0

pymysql

1.1.1

pyreadstat

1.2.8

pytables

3.10.1

python-calamine

0.3.0

pytz

2024.2

s3fs

2024.10.0

SciPy

1.14.1

sqlalchemy

2.0.36

xarray

2024.10.0

xlsxwriter

3.2.0

zstandard

0.23.0

有關更多資訊,請參閱DependenciesOptional dependencies

pytz 現在是可選依賴項#

pandas 現在將標準庫中的 zoneinfo 用作預設時區實現,用於將時區字串傳遞給各種方法。(GH 34916

舊行為

In [1]: ts = pd.Timestamp(2024, 1, 1).tz_localize("US/Pacific")
In [2]: ts.tz
<DstTzInfo 'US/Pacific' LMT-1 day, 16:07:00 STD>

新行為

In [37]: ts = pd.Timestamp(2024, 1, 1).tz_localize("US/Pacific")

In [38]: ts.tz
Out[38]: zoneinfo.ZoneInfo(key='US/Pacific')

pytz 時區物件在直接傳遞時仍然受支援,但它們將不再預設從字串輸入返回。此外,pytz 不再是 pandas 的必需依賴項,但可以透過 pip extra pip install pandas[timezone] 安裝。

此外,pandas 不再為導致歧義或不存在的時間的時區操作引發 pytz 異常。這些情況現在將引發 ValueError

其他 API 更改#

  • IO 方法中不再明確支援第三方 py.path 物件。請改用 pathlib.Path 物件(GH 57091)。

  • read_table()parse_dates 引數預設值為 None,以提高與 read_csv() 的一致性(GH 57476)。

  • Period.to_timestamp()PeriodIndex.to_timestamp() 現在在可能的情況下返回微秒單位的物件,在其他情況下返回納秒單位的物件。這會影響 Period.end_time()PeriodIndex.end_time() 的實際值(GH 56164)。

  • 所有繼承自內建 tuple 的類(包括使用 collections.namedtuple() 建立的型別)在索引操作中現在被視為內建 tuple 進行雜湊處理和比較(GH 57922)。

  • dtype 作為必需引數新增到 ExtensionArray._from_sequence_of_strings()GH 56519)。

  • Series 輸入傳遞給 json_normalize() 現在將保留 SeriesIndex,以前的輸出有一個新的 RangeIndexGH 51452)。

  • 不再明確支援使用 Python 2 建立的 Pickle 和 HDF(.h5)檔案(GH 57387)。

  • 不再支援來自 pandas 版本低於 1.0.0 的 pickled 物件(GH 57155)。

  • 移除了 Index.sort(),該方法總是引發 TypeError。此屬性未定義,將引發 AttributeErrorGH 59283)。

  • MultiIndex 建構函式中移除了未使用的 dtype 引數(GH 60962)。

  • 更新了 DataFrame.to_excel(),使輸出的電子表格沒有樣式。仍然可以使用 Styler.to_excel() 進行自定義樣式設定(GH 54154)。

  • testing.assert_series_equal() 中比較索引時,如果 Index 的資料型別是整數型別,check_exact 預設值為 True。(GH 57386)。

  • 索引集合操作(如並集或交集)在確定結果索引的資料型別時,將忽略空 RangeIndex 或物件資料型別的空 Index 的資料型別(GH 60797)。

  • IncompatibleFrequency 現在繼承自 TypeError 而不是 ValueError。因此,頻率不匹配的連線現在會像其他不可比較的連線一樣強制轉換為物件,並且頻率不匹配的索引之間的算術運算會進行對齊(GH 55782)。

  • Series 的“flex”方法(如 Series.add())不再允許為 other 引數傳遞 DataFrame;請改用 DataFrame 的反向方法(GH 46179)。

  • date_range()timedelta_range() 不再預設 unit="ns",而是會從 startendfreq 引數推斷單位。要覆蓋這些,請顯式指定所需的 unitGH 59031)。

  • CategoricalIndex.append() 不再嘗試將不同資料型別的索引強制轉換為呼叫者的資料型別(GH 41626)。

  • ExtensionDtype.construct_array_type() 現在是普通方法,而不是 classmethodGH 58663)。

  • SeriesIndexExtensionArraylist 之間的算術運算現在將該列表一致地包裝在等同於 Series(my_list).array 的陣列中。要進行任何其他型別的推斷或轉換,請在操作之前顯式進行(GH 62552)。

  • IndexSeries 之間的比較操作現在始終返回 Series,無論哪個物件在左邊還是右邊(GH 36759)。

  • NumPy 函式(如 np.isinf),當在 Index 物件上呼叫時返回布林 dtype,現在返回布林資料型別的 Index 而不是 np.ndarrayGH 52676)。

  • 可以就地操作的方法(replace()fillna()ffill()bfill()interpolate()where()mask()clip())在 inplace=True 時,現在返回修改後的 DataFrame 或 Series(self),而不是 NoneGH 63207)。

  • 所有 Index 建構函式現在預設複製 numpy.ndarrayExtensionArray 輸入,當 copy=None 時,這與 Series 的行為一致(GH 63388)。

棄用#

Copy 關鍵字#

以下方法的 copy 關鍵字引數已被棄用,並將在未來版本中刪除。(GH 57347

Copy-on-Write 使用延遲複製機制,該機制會推遲資料複製,直到需要時為止。使用 .copy 觸發即時複製。從 3.0 版本開始,copy 關鍵字沒有效果,因此可以安全地從程式碼中刪除它。

其他棄用項#

移除先前版本的棄用/更改#

強制棄用別名 MQY 等,改用 MEQEYE 等表示偏移量。#

重新命名了以下偏移量別名(GH 57986)。

偏移量

已移除的別名

新的別名

MonthEnd

M

ME

BusinessMonthEnd

BM

BME

SemiMonthEnd

SM

SME

CustomBusinessMonthEnd

CBM

CBME

QuarterEnd

Q

QE

BQuarterEnd

BQ

BQE

YearEnd

Y

YE

BYearEnd

BY

BYE

其他移除項#

  • DataFrameGroupBy.idxmin()DataFrameGroupBy.idxmax()SeriesGroupBy.idxmin()SeriesGroupBy.idxmax() 現在將在組包含所有 NA 值時,或在使用 skipna=False 並遇到任何 NA 值時,引發 ValueErrorGH 10694GH 57745)。

  • concat() 不再忽略空物件來確定輸出 dtype(GH 39122)。

  • concat() 在所有條目均為 NA 的情況下,不再忽略這些條目的 dtype 來確定結果 dtype(GH 40893)。

  • read_excel(), read_json(), read_html(), and read_xml() 不再接受原始字串或位元組表示的資料。該型別的資料必須被包裝在 StringIOBytesIO 中(GH 53767

  • to_datetime() 指定了 unit 時,不再將字串解析為浮點數,而是像沒有 unit 一樣進行解析(GH 50735

  • SeriesGroupBy.agg() 不再將組的名稱固定到傳遞給提供的 func 的輸入上(GH 51703

  • DataFrame.groupby() 在使用 as_index=False 和聚合方法時,將不再從結果中排除不來自輸入的組合(GH 49519

  • ExtensionArray._reduce() 現在要求在簽名中包含 keepdims: bool = False 引數(GH 52788

  • Series.dt.to_pydatetime() 現在返回一個包含 datetime.datetime 物件的 SeriesGH 52459

  • 除了 name 之外,Index.rename() 中的所有引數現在都只能透過關鍵字傳遞(GH 56493

  • IO 寫入器中除了第一個 path 類引數之外的所有引數現在都只能透過關鍵字傳遞(GH 54229

  • 更改了 Series.__getitem__()Series.__setitem__() 的行為,使其始終將整數鍵視為標籤,而非位置,這與 DataFrame 的行為一致(GH 50617

  • 更改了具有浮點數索引的物件上,使用整數切片時的 Series.__getitem__()Series.__setitem__()DataFrame.__getitem__()DataFrame.__setitem__() 的行為。這現在被視為*位置*索引(GH 49612

  • 不允許 Series.iloc() 的可呼叫引數返回 tupleGH 53769

  • 不允許在 pandas 物件和無 dtype 的序列(例如 listtuple)之間進行邏輯運算(||&^);請先將物件包裝在 SeriesIndexnp.array 中(GH 52264

  • 不允許在具有不匹配索引和非 objectbool 的 dtype 的 Series 之間進行邏輯運算(&^||)時自動向上轉換為 object 型別(GH 52538

  • 不允許在沒有 valueto_replace 不是 dict 型別的情況下呼叫 Series.replace()DataFrame.replace()GH 33302

  • 不允許使用標量資料構建 arrays.SparseArrayGH 53039

  • 不允許使用長度為零的布林索引器索引 Index,現在會引發 ValueErrorGH 55820

  • 不允許將非標準(np.ndarrayIndexExtensionArraySeries)型別傳遞給 isin()unique()factorize()GH 52986

  • 不允許將 pandas 型別傳遞給 Index.view()GH 55709

  • 不允許在 array() 中為 datetime64 和 timedelta64 dtypes 使用“s”、“ms”、“us”、“ns”以外的單位(GH 53817

  • pandas.core.internalspandas.core.internals.api 中移除了 BlockDatetimeTZBlockExtensionBlockcreate_block_manager_from_blocksGH 55139

  • Categorical 建構函式中移除了 fastpath 關鍵字引數(GH 20110

  • PeriodArray 建構函式中移除了 freq 關鍵字引數,請使用“dtype”代替(GH 52462

  • Series.resample()DataFrame.resample() 中移除了 kind 關鍵字引數(GH 58125

  • 移除了 arrays.NumpyExtensionArray 的別名 arrays.PandasArrayGH 53694

  • Series.replace()DataFrame.replace() 中移除了已棄用的 methodlimit 關鍵字引數(GH 53492

  • 移除了擴充套件測試類 BaseNoReduceTestsBaseNumericReduceTestsBaseBooleanReduceTestsGH 54663

  • DatetimeIndex 建構函式中移除了 closednormalize 關鍵字引數(GH 52628

  • 移除了 read_csv()read_table() 中已棄用的 delim_whitespace 關鍵字引數,請使用 sep=r"\s+" 代替(GH 55569

  • 要求 SparseDtype.fill_value()SparseDtype.subtype() 的有效值(GH 53043

  • 停止在 Series.isin()Index.isin() 中自動將非日期時間類值(主要是字串)強制轉換為 datetime64timedelta64PeriodDtype dtypes(GH 53111

  • IndexSeriesDataFrame 建構函式中,當輸入是 pandas 物件(SeriesIndexExtensionArray)時,停止進行 dtype 推理。要保留當前行為,請先在輸入上呼叫 .infer_objectsGH 56012

  • 在將 Index 設定到 DataFrame 中時,停止進行 dtype 推理(GH 56102

  • Index.insert() 中,當使用 object-dtype 索引時,停止進行 dtype 推理;這通常會影響將新條目設定到空的 SeriesDataFrame 時產生的索引/列(GH 51363

  • TimedeltaIndex 建構函式中移除了 closedunit 關鍵字引數(GH 52628, GH 55499

  • Index.sort_values() 中的所有引數現在都只能透過關鍵字傳遞(GH 56493

  • Series.to_dict() 中的所有引數現在都只能透過關鍵字傳遞(GH 56493

  • Categorical.map()na_action 的預設值更改為 NoneGH 51645

  • DataFrame.groupby()Series.groupby()observed 的預設值更改為 TrueGH 51811

  • 強制禁止在原地 setitem 類操作中發生向上轉型;請參見 PDEP6GH 59007

  • 強制在 testing.assert_series_equal()testing.assert_frame_equal() 中,對於 object dtype 和不匹配的 null-like 值(現在被視為不相等)進行棄用強制執行(GH 18463

  • 強制執行 datetime64DatetimeTZDtypePeriodDtype dtypes 上 allany 約簡的棄用強制執行(GH 58029

  • 強制執行 str.contains()str.startswith()str.endswith() 中,na 引數不允許非 bool 和 NA 值(GH 59615

  • 強制執行 date_range()period_range()timedelta_range()interval_range()periods 引數不允許 float 型別(GH 56036

  • 強制執行 to_datetime() 解析混合時區字串的棄用,除非使用者傳遞 utc=TrueGH 57275

  • 強制執行 Series.value_counts()Index.value_counts() 在 object dtype 時,對結果的 .index 進行 dtype 推理的棄用強制執行(GH 56161

  • 強制執行 DataFrameGroupBy.get_group()SeriesGroupBy.get_group() 允許 name 引數為長度為 1 的列表分組時的非元組值的棄用強制執行(GH 54155

  • 強制執行 Series.interpolate()DataFrame.interpolate() 在 object-dtype 上的棄用強制執行(GH 57820

  • 強制執行 offsets.Tick.delta() 的棄用,請使用 pd.Timedelta(obj) 代替(GH 55498

  • 強制執行 DataFrame 約簡 sumprodstdvarsemaxis=None 等同於 axis=0 的行為的棄用。現在 axis=None 將在兩個軸上進行約簡;特別是在執行如 numpy.sum(df) 時(GH 21597

  • 強制執行 core.internals 成員 DatetimeTZBlock 的棄用(GH 58467

  • read_csv()read_table()read_fwf()read_excel() 中,date_parser 引數的棄用,建議使用 date_formatGH 50601

  • read_csv() 中,keep_date_col 關鍵字引數的棄用(GH 55569

  • Rolling.quantile()Expanding.quantile() 中,quantile 關鍵字引數的棄用,已重新命名為 q。(GH 52550

  • read_csv() 中,infer_datetime_format 引數的棄用,因為其嚴格版本已成為預設值(GH 48621

  • read_csv()parse_dates 中,組合解析的日期列的棄用(GH 55569

  • 強制執行 api.extensions.take() 引數中非標準(np.ndarrayExtensionArrayIndexSeries)型別的棄用強制執行(GH 52981

  • 強制執行解析系統時區字串到 tzlocal 的棄用,因為它依賴於系統時區,請改用傳遞 tz 關鍵字引數(GH 50791

  • 強制執行向 SeriesGroupBy.agg() 傳遞字典的棄用強制執行(GH 52268

  • 強制執行 YearBegin 中表示頻率的字串 AS,以及表示具有各種財年起點的年度頻率的字串 AS-DECAS-JAN 等的棄用(GH 57793

  • 強制棄用 YearEnd 中表示頻率的字串 A,以及表示具有不同財年末年度頻率的字串 A-DECA-JAN 等 (GH 57699)

  • 強制棄用 BYearBegin 中表示頻率的字串 BAS,以及表示具有不同財年起始年度頻率的字串 BAS-DECBAS-JAN 等 (GH 57793)

  • 強制棄用 BYearEnd 中表示頻率的字串 BA,以及表示具有不同財年末年度頻率的字串 BA-DECBA-JAN 等 (GH 57793)

  • 強制棄用 HourBusinessHourCustomBusinessHour 中表示頻率的字串 HBHCBH (GH 59143)

  • 強制棄用 Timedelta 中表示單位的字串 HBHCBH (GH 59143)

  • 強制棄用 MinuteMilliMicroNano 中表示頻率的字串 TLUN (GH 57627)

  • 強制棄用 Timedelta 中表示單位的字串 TLUN (GH 57627)

  • 強制棄用 concat()len(keys) != len(objs) 時截斷到較短長度的行為。現在這會引發 ValueError (GH 43485)

  • 強制棄用 DataFrame.replace()Series.replace() 中可能引入新類別的 CategoricalDtype 的行為。(GH 58270)

  • 強制棄用 Series.argsort() 在存在 NA 值時(GH 58232)的行為。

  • 強制棄用 Series.interpolate()DataFrame.interpolate() 中的值“pad”、“ffill”、“bfill”和“backfill”(GH 57869

  • 強制棄用並移除 Categorical.to_list(),請改用 obj.tolist()GH 51254

  • 強制棄用對 所有相關方法 的靜默降級 (GH 54710)

  • DataFrame.stack() 中,future_stack 的預設值現在為 True;指定 False 將引發 FutureWarning (GH 55448)

  • level(長度為 1 的列表)對 DataFrameGroupBySeriesGroupBy 進行迭代時,將返回長度為 1 的組的元組 (GH 50064)

  • 方法 applyaggtransform 將不再用等效的 pandas 實現替換 NumPy 函式(例如 np.sum)和內建函式(例如 min);如果您希望使用 pandas 實現,請使用字串別名(例如 "sum""min")(GH 53974)

  • DataFrame.shift()Series.shift()DataFrameGroupBy.shift() 中同時傳遞 freqfill_value 現在會引發 ValueError (GH 54818)

  • 移除了支援布林 dtype 的 DataFrameGroupBy.quantile()SeriesGroupBy.quantile() (GH 53975)

  • 移除了 DateOffset.is_anchored()offsets.Tick.is_anchored() (GH 56594)

  • 移除了 DataFrame.applymapStyler.applymapStyler.applymap_index (GH 52364)

  • 移除了 DataFrame.boolSeries.bool (GH 51756)

  • 移除了 DataFrame.firstDataFrame.last (GH 53710)

  • 移除了 DataFrame.swapaxesSeries.swapaxes (GH 51946)

  • 移除了 DataFrameGroupBy.grouperSeriesGroupBy.grouper (GH 56521)

  • 移除了 DataFrameGroupby.fillnaSeriesGroupBy.fillna` (GH 55719)

  • 移除了 Index.format,請改用 str 型別的 Index.astype() 或帶有 formatter 函式的 Index.map()GH 55439

  • 移除了 Resample.fillna (GH 55719)

  • 移除了 Series.__int__Series.__float__。請改用 int(Series.iloc[0])float(Series.iloc[0])。(GH 51131)

  • 移除了 Series.ravel (GH 56053)

  • 移除了 Series.view (GH 56054)

  • 移除了 StataReader.close (GH 49228)

  • DataFrameSeriesarrays.ArrowExtensionArray 中移除了 _data (GH 52003)

  • DataFrame.groupby()Series.groupby()DataFrame.rolling()Series.rolling()DataFrame.resample()Series.resample() 中移除了 axis 引數 (GH 51203)

  • 移除了所有 groupby 操作中的 axis 引數 (GH 50405)

  • 移除了 Series.apply() 中的 convert_dtype (GH 52257)

  • 移除了 DataFrame.align() 中的 methodlimitfill_axisbroadcast_axis 關鍵字 (GH 51968)

  • 移除了 pandas.api.types.is_intervalpandas.api.types.is_period,請改用 isinstance(obj, pd.Interval)isinstance(obj, pd.Period)GH 55264

  • 移除了 pandas.io.sql.execute (GH 50185)

  • 移除了 pandas.value_counts,請改用 Series.value_counts()GH 53493

  • 移除了 read_gbqDataFrame.to_gbq。請改用 pandas_gbq.read_gbqpandas_gbq.to_gbq https://pandas-gbq.readthedocs.io/en/latest/api.html (GH 55525)

  • 移除了 read_parquet() 中的 use_nullable_dtypesGH 51853

  • 移除了 PeriodIndex 建構函式中的 yearmonthquarterdayhourminutesecond 關鍵字,請改用 PeriodIndex.from_fields()GH 55960

  • DataFrame.pct_change()Series.pct_change()DataFrameGroupBy.pct_change()SeriesGroupBy.pct_change() 中移除了 limit 引數;method 引數必須設定為 None,並且將在 pandas 的未來版本中移除(GH 53520

  • 移除了 DataFrameGroupBy.get_group()SeriesGroupBy.get_group() 中已棄用的 obj 引數(GH 53545

  • 移除了 Series.agg() 使用 Series.apply() 的已棄用行為(GH 53325

  • 移除了 Series.fillna()DataFrame.fillna() 中的已棄用關鍵字 methodGH 57760

  • 移除了選項 mode.use_inf_as_na,請先將 inf 條目轉換為 NaNGH 51684

  • 移除了對 DataFrame.from_records()DataFrame 的支援(GH 51697

  • 移除了對 to_datetime()to_timedelta()to_numeric()errors="ignore" 的支援(GH 55734

  • 移除了對 DataFrame.take()slice 的支援(GH 51539

  • 移除了 ArrayManager (GH 55043)

  • 移除了 Series 建構函式中的 fastpath 引數 (GH 55466)

  • 移除了 Indexis_booleanis_integeris_floatingholds_integeris_numericis_categoricalis_objectis_interval 屬性 (GH 50042)

  • 移除了 PeriodIndex 中的 ordinal 關鍵字,請改用 PeriodIndex.from_ordinals()GH 55960

  • 移除了 Resampler 方法中的未使用引數 *args**kwargs (GH 50977)

  • 解析字串到日期時間時,無法識別的時區現在會引發 ValueError (GH 51477)

  • 移除了 Grouper 的屬性 axgroupsindexerobjGH 51206, GH 51182

  • 移除了 read_csv()read_table() 中的已棄用關鍵字 verboseGH 56556

  • 移除了 ExtensionArray.fillna() 中的 method 關鍵字,請改用 ExtensionArray._pad_or_backfillGH 53621

  • 移除了 DataFrameGroupBydtypes 屬性 (GH 51997)

  • 強制棄用 argminargmaxidxminidxmaxskipna=False 且遇到 NA 值或所有值都是 NA 值時返回結果的行為;這些操作現在在這種情況下會引發錯誤(GH 33941, GH 51276

  • 強制棄用 StringDtype 的儲存選項“pyarrow_numpy”(GH 60152)

  • 移除了在 DataFrameGroupBy.apply()Resampler.apply() 中指定 include_groups=TrueGH 7155

效能改進#

  • 消除了訪問器屬性(例如 Series.str)中到原始 pandas 物件的迴圈引用。但是,訪問器例項化不再被快取(GH 47667, GH 41357

  • 當構造的 valuesrange 時,Categorical.categories 返回 RangeIndex 列而不是 Index。(GH 57787

  • datadict 時,DataFrame 在可能的情況下返回 RangeIndex 列(GH 57943

  • datadict 時,Series 在可能的情況下返回 RangeIndex 索引(GH 58118

  • objs 包含 SeriesDataFrameaxis=0 時,concat() 在可能的情況下返回 RangeIndex 列(GH 58119

  • keysrangeRangeIndex 時,concat()MultiIndex 結果中返回 RangeIndex 級別(GH 57542

  • 當追加的值可以繼續 RangeIndex 時,RangeIndex.append() 返回 RangeIndex 而不是 IndexGH 57467

  • 當索引中有重複值時,Series.nlargest() 的效能有所提高(GH 55767

  • 當可能時,Series.str.extract() 返回 RangeIndex 列而不是 Index 列(GH 57542

  • Series.str.partition() 結合 ArrowDtype 在可能的情況下返回 RangeIndex 列而不是 Index 列(GH 57768

  • DataFrame 中,當 datadict 且指定了 columns 時,效能得到提升(GH 24368

  • MultiIndex 中,設定 MultiIndex.names 不會使所有快取的操作失效,效能得到提升(GH 59578

  • DataFrameGroupBy.ffill()DataFrameGroupBy.bfill()SeriesGroupBy.ffill()SeriesGroupBy.bfill() 中,效能得到提升(GH 56902

  • DataFrame.join() 中,對於已排序但非唯一的索引,效能得到提升(GH 56941

  • DataFrame.join() 中,當左右索引非唯一且 how"left""right""inner" 時,效能得到提升(GH 56817

  • DataFrame.join() 中,當 how="left"how="right"sort=True 時,效能得到提升(GH 56919

  • DataFrame.to_csv() 中,當 index=False 時,效能得到提升(GH 59312

  • Index.join() 中,透過在結果與輸入之一匹配的情況下傳播快取屬性,效能得到提升(GH 57023

  • Index.take() 中,當 indices 是從零到索引長度的完整範圍索引器時,效能得到提升(GH 56806

  • Index.to_frame() 中,在可能的情況下返回 RangeIndex 列的 Index,效能得到提升(GH 58018

  • MultiIndex._engine() 中,使用更小的 dtype(如果可能),效能得到提升(GH 58411

  • MultiIndex.equals() 中,對於等長索引,效能得到提升(GH 56990

  • MultiIndex.memory_usage() 中,忽略未快取的索引引擎,效能得到提升(GH 58385

  • RangeIndex.__getitem__() 中,當使用布林掩碼或整數時,在可能的情況下返回 RangeIndex 而不是 Index,效能得到提升(GH 57588

  • RangeIndex.append() 中,當追加相同的索引時,效能得到提升(GH 57252

  • RangeIndex.argmin()RangeIndex.argmax() 中,效能得到提升(GH 57823

  • RangeIndex.insert() 中,當 RangeIndex 為空時,返回 RangeIndex 而不是 Index,效能得到提升(GH 57833

  • RangeIndex.round() 中,在可能的情況下返回 RangeIndex 而不是 Index,效能得到提升(GH 57824

  • RangeIndex.searchsorted() 中,效能得到提升(GH 58376

  • RangeIndex.to_numpy() 中,指定 na_value 時,效能得到提升(GH 58376

  • RangeIndex.value_counts() 中,效能得到提升(GH 58376

  • RangeIndex.join() 中,在可能的情況下返回 RangeIndex 而不是 Index,效能得到提升(GH 57651, GH 57752

  • RangeIndex.reindex() 中,在可能的情況下返回 RangeIndex 而不是 Index,效能得到提升(GH 57647, GH 57752

  • RangeIndex.take() 中,在可能的情況下返回 RangeIndex 而不是 Index,效能得到提升(GH 57445, GH 57752

  • merge() 中,如果可以使用雜湊連線,效能得到提升(GH 57970

  • merge() 中,當連線鍵具有不同的 dtype 並需要向上轉型時,效能得到提升(GH 62902

  • CategoricalDtype.update_dtype() 中,當 dtype 是具有非 None 類別且有序的 CategoricalDtype 時,效能得到提升(GH 59647

  • DataFrame.__getitem__() 中,當 key 是一個具有許多列的 DataFrame 時,效能得到提升(GH 61010

  • DataFrame.astype() 中,當轉換為擴充套件浮點數 dtype(例如 “Float64”)時,效能得到提升(GH 60066

  • DataFrame.merge() 中,透過為所有基於 Arrow 的 dtype 使用 Arrow 原生路徑,效能得到提升(GH 63435

  • DataFrame.stack() 中,當使用 future_stack=True 且 DataFrame 沒有 MultiIndex 時,效能得到提升(GH 58391

  • DataFrame.to_hdf() 中,避免不必要地重新開啟 HDF5 檔案,以加快向具有大量組的檔案新增資料的速度(GH 58248

  • DataFrame.where() 中,當 cond 是一個具有許多列的 DataFrame 時,效能得到提升(GH 61010

  • DataFrameGroupBy.__len__SeriesGroupBy.__len__ 中,效能得到提升(GH 57595

  • 在字串 dtype 的索引操作中,效能得到提升(GH 56997

  • RangeIndex 上的一元方法中,在可能的情況下返回 RangeIndex 而不是 Index,效能得到提升(GH 57825

Bug 修復#

分類#

  • 在使用具有 ArrowDtypeIndex 構建 Categorical 時存在錯誤(GH 60563

  • Categorical 中,從具有 dtype='object' 的 pandas SeriesIndex 構建時,未能將類別的 dtype 保持為 object;現在,對於這些情況,categories.dtype 被保持為 object,而具有 dtype='object' 的 numpy 陣列和 Python 序列繼續推斷最具體的 dtype(例如,如果所有元素都是字串,則推斷為 str)(GH 61778

  • pandas.Categorical 中,在使用“string”dtype 時顯示不帶引號的字串類別存在錯誤(GH 63045

  • Series.apply() 中,對於 CategoricalDtypenan 被忽略存在錯誤(GH 59938

  • bdate_range() 中,使用頻率 freq="cbh" 會引發 ValueError 存在錯誤(GH 62849

  • testing.assert_index_equal() 中,當 check_categorical=Trueexact=False 時,對於不可比較的 CategoricalIndex,會引發 TypeError 而不是 AssertionErrorGH 61935

  • Categorical.astype() 中,當 copy=False 時,仍然會觸發程式碼的複製存在錯誤(GH 62000

  • DataFrame.pivot()DataFrame.set_index() 中,對於具有 pyarrow 字典 dtype 的列,會引發 ArrowNotImplementedError 存在錯誤(GH 53051

  • Series.convert_dtypes() 中,當 dtype_backend="pyarrow" 時,空的 CategoricalDtype Series 引發錯誤或被轉換為 null[pyarrow] 存在錯誤(GH 59934

日期時間型別#

  • is_year_start 中,透過 date_range() 使用頻率 'MS' 構建的 DatetimeIndex 的年份或季度開始屬性不正確存在錯誤(GH 57377

  • DataFrame 中,當 dtypetimedelta64data 是包含 None 的列表時,引發 ValueError 存在錯誤(GH 60064

  • Timestamp 建構函式中,當顯式指定 tz=None 與時區感知的 tzinfo 或資料結合使用時,未能引發錯誤存在錯誤(GH 48688

  • Timestamp 建構函式中,當給定非標準單位的 np.datetime64 物件時,未能引發錯誤存在錯誤(GH 25611

  • date_range() 中,有時最後一個有效時間戳未能生成存在錯誤(GH 56134

  • date_range() 中,使用負頻率值時,未能包含開始和結束值之間的所有點存在錯誤(GH 56147

  • infer_freq() 中,對具有 ArrowDtype 時間戳 dtype 的 Series,錯誤地引發 TypeErrorGH 58403

  • to_datetime() 中,將 lxml.etree._ElementUnicodeResultformat 一起傳遞時引發 TypeError 存在錯誤。現在已處理 str 的子類(GH 60933

  • tseries.api.guess_datetime_format() 中,當 “%Y” == “%H%M” 時,會失敗,無法推斷時間格式(GH 57452

  • tseries.frequencies.to_offset() 中,無法解析以 “LWOM” 開頭的頻率字串存在錯誤(GH 59218

  • DateOffset.rollback()(及子類方法)中,當 normalize=True 時,回滾長度會多一個偏移量存在錯誤(GH 32616

  • DataFrame.agg() 中,處理缺失值時導致 IndexError 存在錯誤(GH 58810

  • DataFrame.fillna() 中,當使用超出範圍的時間戳填充 datetime64[ns] 列時,會引發 AssertionError 而不是 OutOfBoundsDatetime。現在正確引發 OutOfBoundsDatetimeGH 61208

  • DataFrame.min()DataFrame.max() 中,將 datetime64timedelta64 列轉換為 float64 並丟失精度存在錯誤(GH 60850

  • DatetimeIndex.asof() 中,使用字串鍵會導致不正確的結果存在錯誤(GH 50946

  • DatetimeIndex.is_year_start()DatetimeIndex.is_quarter_start() 中,對於大於 “1C” 的自定義營業日頻率,不會引發錯誤存在錯誤(GH 58664

  • DatetimeIndex.is_year_start()DatetimeIndex.is_quarter_start() 中,對於雙位數頻率返回 False 存在錯誤(GH 58523

  • DatetimeIndex.union()DatetimeIndex.intersection() 中,當 unit 非納秒時存在錯誤(GH 59036

  • DatetimeIndex.where()TimedeltaIndex.where() 中,在某些情況下未能設定 freq=None 存在錯誤(GH 24555

  • Index.union() 中使用 pyarrow 時間戳 dtype 時出現錯誤,錯誤地返回 object dtype(GH 58421

  • Series.dt.microsecond() 中使用 pyarrow 支援的 Series 時,產生不正確的結果(GH 59154

  • Timestamp.normalize()DatetimeArray.normalize() 中出現錯誤,當非常小(遙遠的過去)的值導致整數溢位時,不會引發錯誤,而是返回不正確的結果(GH 60583

  • Timestamp.replace() 中出現錯誤,當替換引入非零 nanosecondmicrosecond 時,未能更新 unit 屬性(GH 57749

  • to_datetime() 中出現錯誤,當傳遞不常見的日期字串時,不尊重 `dayfirst` 引數(GH 58859

  • to_datetime() 中對包含缺失值的浮點數陣列進行操作時,會引發 FloatingPointErrorGH 58419

  • to_datetime() 中處理具有年、月、日等列的 float32 資料時,會導致精度問題和不正確的結果(GH 60506

  • to_datetime() 中出現錯誤,在任何失敗場景下都會報告不正確的索引(GH 58298

  • to_datetime() 中使用 format="ISO8601"utc=True 時出現錯誤,本地時間戳會錯誤地繼承系列中前一個時間戳的時區偏移(GH 61389

  • to_datetime() 中,當 `arg` 是具有 `ps` 單元的 `np.datetime64` 物件時,會錯誤地進行轉換(GH 60341

  • 在具有 `np.datetime64` dtype 和 `timestamp[pyarrow]` dtypes 的物件之間進行比較時出現錯誤,錯誤地引發 TypeErrorGH 60937

  • 在具有 pyarrow date dtype 和 `timestamp[pyarrow]` 或 `np.datetime64` dtype 的物件之間進行比較時出現錯誤,未能將它們視為不可比較(GH 62157

  • 在使用具有 `timestamp` 型別的 ArrowDtype 構建陣列時出現錯誤,錯誤地允許 `Decimal("NaN")`(GH 61773

  • 在從時區感知的 ArrowDtype 構建時區感知的陣列時出現錯誤,當 `tz=None` 時,錯誤地將這些視為 UTC 時間,而不是像 DatetimeTZDtype 那樣視為本地時間(GH 61775

  • value_counts() 中保留頻率時出現錯誤,特別是對於 DatetimeIndex()TimedeltaIndex()GH 33830

  • 在將具有不匹配解析度的標量值設定到具有非納秒 datetime64timedelta64DatetimeTZDtype 的陣列中時出現錯誤,錯誤地截斷這些標量(GH 56410

時間差#

  • Timedelta.to_pytimedelta() 中提高了精度,以便對基於納秒的大型 Timedelta 一致地四捨五入微秒(GH 57841

  • Timedelta 建構函式中出現錯誤,當傳遞無效關鍵字時未能引發錯誤(GH 53801

  • DataFrame.cumsum() 中出現錯誤,當 dtype 為 timedelta64[ns] 時會引發 IndexErrorGH 57956

  • 在將非納秒單位的 Timedelta 物件與 Python datetime.datetime 物件相加或相減時出現錯誤,導致結果不正確;現在當 Timedeltas 在 datetime.timedelta 實現範圍之內時,此操作可以正常工作(GH 53643

  • 在具有 `timedelta64` dtype 的乘法運算中出現錯誤,當乘以布林物件或 dtype 時未能引發 TypeErrorGH 58054

  • 在具有 `timedelta64` dtype 的乘法運算中出現錯誤,當乘以 numpy 可空 dtype 或 pyarrow 整數 dtype 時錯誤地引發(GH 58054

  • Series 建構函式中出現錯誤,當從整數構建 timedelta 序列時,未能遵循 `timedelta64[unit]` dtype 的單位,例如 `pd.Series([0, 1, 2], dtype="timedelta64[s]")` 仍然將數字解釋為納秒而不是秒。現在,它將根據指定 dtype 的單位解釋傳入的整數(GH 48312, GH 52457

時區#

  • DatetimeIndex.union()DatetimeIndex.intersection()DatetimeIndex.symmetric_difference() 中出現錯誤,當合並兩個具有相同時區但不同單位的 DatetimeIndex 物件時,時區被更改為 UTC(GH 60080

  • Series.dt.tz_localize() 中使用時區感知的 ArrowDtype 時,當 `tz=None` 時,錯誤地轉換為 UTC(GH 61780

  • 修復了 date_range() 中的錯誤,當時區感知的端點帶有日曆偏移量(例如 `"MS"`)時,在 DST 回溯時會失敗。現在這些端點會尊重 `ambiguous`/`nonexistent` 引數(GH 52908

數值#

轉換#

字串#

Interval#

索引#

  • DataFrame.__getitem__() 中,當切片一個有很多行的 DataFrame 時,會引發 OverflowErrorGH 59531

  • DataFrame.__setitem__() 中,對一個空的 DataFrame 使用元組時,會損壞該幀(GH 54385

  • DataFrame.from_records() 中,當在 `index` 中傳遞空列表時,會引發 ValueErrorGH 58594

  • DataFrame.loc()DataFrame.iloc() 中,當從具有混合資料型別的 DataFrame 中選擇時,返回了不正確的 dtype(GH 60600

  • DataFrame.loc() 中,當向 Series 設定兩個索引時,loc-set 的行為不一致(GH 59933

  • Index.equals() 中,當比較具有字串 dtype 的 SeriesIndex 時出現錯誤(GH 61099

  • Index.get_indexer() 及類似方法在 NaN 位於第 128 位或之後時出現錯誤(GH 58924)

  • MultiIndex.insert() 在插入到類 datetime 的級別的新值被強制轉換為 NaT 並導致索引失敗時出現錯誤(GH 60388)

  • Series.__setitem__() 在分配帶有布林索引器的布林 Series 時會引發 LossySetitemError(GH 57338)

  • 使用解析度高於索引的 DatetimeIndex 和 Timestamp 端點對 obj.loc[start:stop] 進行索引時出現錯誤(GH 63262)

  • 列印 Index.names 和 MultiIndex.levels 時不會轉義單引號(GH 60190)

  • 在合併塊的情況下,使用 PeriodDtype 列對 DataFrame 進行重新索引時出現錯誤(GH 60980、GH 60273)

  • DataFrame.__getitem__() 在 Python 3.12 中使用 slice 呼叫時返回已修改的列(GH 57500)

  • DataFrame.loc.__getitem__() 和 DataFrame.iloc.__getitem__() 在具有整數類別的 CategoricalDtype 列上使用時,在嘗試索引包含 NaN 條目的行時會引發錯誤(GH 58954)

  • Index.__getitem__() 在使用 0 維 np.ndarray 鍵時錯誤地引發異常(GH 55601)

  • Index.get_indexer() 在未正確轉換新字串資料型別缺失值時出現錯誤(GH 55833)

  • Index.intersection()、Index.union()、MultiIndex.intersection() 和 MultiIndex.union() 在對相同索引進行操作時返回原始 Index 的引用而不是新例項,這可能導致修改結果時元資料損壞(GH 63169)

  • 使用 DataFrame.loc.__setitem__() 或 Series.loc.__setitem__() 新增新行時出現錯誤,在某些情況下未能保留物件索引上的 dtype(GH 41626)

  • 在具有 timestamp[pyarrow] dtype 的 DatetimeIndex 上或具有 duration[pyarrow] dtype 的 TimedeltaIndex 上進行索引時出現錯誤(GH 62277)

Missing#

  • DataFrame.fillna() 和 Series.fillna() 在 ExtensionArray dtype 上忽略 limit 引數時出現錯誤(GH 58001)

  • MultiIndex.fillna() 的錯誤訊息引用了 isna 而不是 fillna(GH 60974)

  • NA.__and__()、NA.__or__() 和 NA.__xor__() 在與 np.bool_ 物件操作時出現錯誤(GH 58427)

  • NA 和 Int64 dtype 物件之間的 divmod 操作出現錯誤(GH 62196)

  • 修復了 Series.replace() 和 DataFrame.replace() 在嘗試替換 Float64Dtype 物件中的 NA 值(使用 np.nan)時的錯誤;現在使用 pd.set_option("mode.distinguish_nan_and_na", True) 可以正常工作,否則則無關緊要(GH 55127)

  • 修復了 Series.replace() 和 DataFrame.replace() 在嘗試替換 Int64Dtype 物件中的 np.nan 值(使用 NA)時的錯誤;現在使用 pd.set_option("mode.distinguish_nan_and_na", True) 為無操作,否則則無關緊要(GH 51237)

MultiIndex#

  • DataFrame.loc() 在 axis=0 和 MultiIndex 上設定值時,會新增額外的列(GH 58116)

  • DataFrame.melt() 在列是 MultiIndex 時,不接受 var_name 中的多個名稱(GH 58033)

  • MultiIndex.insert() 在 unified location of index -1 處未正確插入 NA 值(GH 59003)

  • MultiIndex.get_level_values() 訪問 DatetimeIndex 時未沿襲 frequency 屬性(GH 58327、GH 57949)

  • 在具有未對齊 MultiIndex 列的 DataFrame 算術運算中出現錯誤(GH 60498)

  • 在具有未對齊 MultiIndex 的 Series 的 DataFrame 算術運算中出現錯誤(GH 61009)

  • MultiIndex.union() 在索引具有不同名稱的重複項時引發錯誤(GH 62059)

  • MultiIndex.from_tuples() 在輸入包含 NaN 值的元組時導致輸出錯誤的錯誤(GH 60695、GH 60988)

  • DataFrame.__setitem__() 中的列對齊邏輯會使用空索引重新索引分配的值,從而錯誤地將所有值設定為 NaN(GH 61841)

  • DataFrame.reindex() 和 Series.reindex() 在將 Index 重新索引到 MultiIndex 時,會錯誤地將所有值設定為 NaN(GH 60923)

I/O#

  • DataFrame 和 Series 中 collections.abc.Mapping 元素的 repr 出現錯誤(GH 57915)

  • DataFrame.to_hdf() 和 read_hdf() 在處理具有非納秒解析度的 timedelta64 dtype 時,未能正確地往返(GH 63239)

  • 修復了 on_bad_lines 可呼叫物件在返回過多欄位時的錯誤:現在會發出 ParserWarning 並截斷額外欄位,無論 index_col 如何(GH 61837)

  • pandas.json_normalize() 在設定 max_level 時,對 data 中非 dict 項的處理不一致。現在,如果 data 是包含非 dict 項的列表,則該函式將引發 TypeError(GH 62829)

  • pandas.json_normalize() 在 meta 包含非字串鍵(例如 int)且指定了 record_path 時引發 TypeError,這與 record_path 為 None 時的行為不一致(GH 63019)

  • DataFrame.to_json() 在 index 引數是 DataFrame.column 中的值且 Index.name 為 None 時出現錯誤。現在,這會引發 ValueError(GH 58925)

  • io.common.is_fsspec_url() 未能識別連結的 fsspec URL(GH 48978)

  • DataFrame._repr_html_() 忽略了 "display.float_format" 選項(GH 59876)

  • DataFrame.from_records() 在 data 是空迭代器且 nrows=0 時,忽略了 columns 和 index 引數(GH 61140)

  • DataFrame.from_records() 未能正確初始化子類(GH 57008)

  • DataFrame.from_records() 中,當 columns 引數是 numpy 結構化陣列時,未能重新排序和過濾掉列(GH 59717)

  • DataFrame.to_dict() 在列不唯一且 orient='tight' 時引發不必要的 UserWarning(GH 58281)

  • DataFrame.to_excel() 在寫入空的 DataFrame(兩軸均為 MultiIndex)時出現錯誤(GH 57696)

  • DataFrame.to_excel() 中,具有 period 級別的 MultiIndex 索引不是日期的錯誤(GH 60099)

  • DataFrame.to_stata() 在匯出包含長字串(Stata strL)和 pd.NA 值的列時出現錯誤(GH 23633)

  • DataFrame.to_stata() 在編碼長度和普通長度不匹配時出現錯誤(GH 61583)

  • DataFrame.to_stata() 在寫入 DataFrame 且 byteorder='big' 時出現錯誤(GH 58969)

  • DataFrame.to_stata() 在寫入超過 32000 個值標籤時出現錯誤(GH 60107)

  • DataFrame.to_string() 在處理巢狀 DataFrame 時引發 StopIteration 的錯誤(GH 16098)

  • HDFStore.get() 未能正確儲存 datetime64[s] dtype 的資料(GH 59004)

  • HDFStore.select() 在對分類字串列進行查詢時導致意外結果(GH 57608)

  • MultiIndex.factorize() 在處理長度為 0 的索引時錯誤地引發異常(GH 57517)

  • read_csv() 在 encoding_errors 不是字串時導致分段錯誤(GH 59059)

  • read_csv() 的 c 和 python 引擎在解析具有大指數的數字時導致溢位。現在,具有大正指數的數字將解析為 inf 或 -inf(取決於尾數的符號),而具有大負指數的數字將解析為 0.0(GH 62617、GH 38794、GH 62740)

  • DataFrame.to_csv() 中,當 escapechar 不是 None 時,quotechar 未被轉義(GH 61407)

  • read_csv() 在指定 index_col 且 na_values 是包含 None 鍵的字典時引發 TypeError(GH 57547)

  • read_csv() 在指定 nrows 和 iterator 但未指定 chunksize 時引發 TypeError(GH 59079)

  • read_csv() 中,連結的 fsspec TAR 檔案和 compression="infer" 導致 tarfile.ReadError(GH 60028)

  • read_csv() 未能適當地跳過指示的行,導致空資料錯誤(GH 62739)

  • read_csv() 中,當 na_values 是非字串值的列表時,na_values 的順序導致不一致(GH 59303)

  • read_csv() 的 c 和 python 引擎將大整數讀取為字串。現在將它們讀取為 python 整數(GH 51295)

  • read_csv() 的 engine="c" 在讀取具有前導整數的大浮點數時將其讀取為字串。現在將它們讀取為浮點數(GH 51295)

  • read_csv() 的 engine="pyarrow" 和 dtype="Int64" 導致精度損失(GH 56136)

  • read_excel() 在 dtype="boolean" 時,傳遞布林值陣列會引發 ValueError(GH 58159)

  • read_html() 中,標題行中的 rowspan 導致錯誤地轉換為 DataFrame(GH 60210)

  • read_json() 在 engine="pyarrow" 時忽略給定的 dtype 的錯誤 (GH 59516)

  • read_json() 在 typ 引數不嚴格等於 "frame" 或 "series" 時不進行驗證的錯誤 (GH 59124)

  • read_json() 在字串形式的極端值整數被錯誤地解析為不同整數的錯誤 (GH 20608)

  • read_stata() 在輸入檔案以大端格式儲存幷包含 strL 資料時引發 KeyError 的錯誤 (GH 58638)

  • read_stata() 在格式版本 111 及更早版本中,極端值整數被錯誤地解釋為缺失值的錯誤 (GH 58130)

  • read_stata() 在格式版本 105 及更早版本中,雙精度型別的缺失碼未被識別的錯誤 (GH 58149)

  • set_option() 將 pandas 選項 display.html.use_mathjax 設定為 False 無效的錯誤 (GH 59884)

  • to_excel() 在 passing merge_cells=False 時,MultiIndex 列被合併到單行的錯誤 (GH 60274)

Period#

  • 傳遞無效的 period 別名給 PeriodIndex.to_timestamp() 時,錯誤訊息已修復 (GH 58974)

  • 接近最小時間戳(微秒和毫秒解析度)的可恢復溢位已修復 (GH 63278)

繪圖#

  • DataFrameGroupBy.boxplot() 在存在多個分組時失敗的錯誤 (GH 14701)

  • DataFrame.plot.bar() 在使用 subplots 和 stacked=True 時堆疊不正確的錯誤 (GH 61018)

  • DataFrame.plot.bar() 在 stacked=True 時,具有零高度段的堆疊條上的標籤被錯誤地放置在底部,而不是前一個段的標籤位置的錯誤 (GH 59429)

  • DataFrame.plot.line() 在同時設定 color 和 dict 樣式時引發 ValueError 的錯誤 (GH 59461)

  • DataFrame.plot() 在頻率乘數大於一時,會向右移動的錯誤 (GH 57587)

  • DataFrame.plot() 在繪製每個子圖多於一列時,title 需要額外標題的錯誤 (GH 61019)

  • Series.plot() 阻止在同一圖上對齊線圖和條形圖的錯誤 (GH 61161)

  • Series.plot() 阻止對齊線圖和散點圖的錯誤 (GH 61005)

  • Series.plot() 在 kind="pie" 與 ArrowDtype 一起使用時的錯誤 (GH 59192)

  • 繪製具有非納秒解析度的 TimedeltaIndex 時,顯示不正確標籤的錯誤 (GH 63237)

Groupby/resample/rolling#

  • DataFrameGroupBy 縮減中,numeric_only 引數允許非布林值,現在傳遞非布林值將引發錯誤的錯誤 (GH 62778)

  • DataFrameGroupBy.__len__() 和 SeriesGroupBy.__len__() 在分組包含 NA 值且 dropna=False 時會引發錯誤的錯誤 (GH 58644)

  • DataFrameGroupBy.agg() 和 SeriesGroupBy.agg() 在輸入值為 pyarrow dtype 時返回 numpy dtype 值的錯誤,而不是返回 pyarrow dtype 值 (GH 53030)

  • DataFrameGroupBy.agg() 在存在字典輸入和重複列時引發 AttributeError 的錯誤,而不是返回聚合了所有重複列的 DataFrame (GH 55041)

  • DataFrameGroupBy.agg() 在將使用者定義的函式應用於空 DataFrame 時返回 Series 而不是空 DataFrame 的錯誤 (GH 61503)

  • DataFrameGroupBy.any() 在其中所有 Timedelta 值都是 NaT 的組返回 True 的錯誤 (GH 59712)

  • DataFrameGroupBy.apply() 和 SeriesGroupBy.apply() 在 group_keys=False 的空 DataFrame 上,仍使用組鍵建立輸出索引的錯誤 (GH 60471)

  • DataFrameGroupBy.apply() 和 SeriesGroupBy.apply() 未保留子類化 DataFrame 和 Series 的 _metadata 屬性的錯誤 (GH 62134)

  • DataFrameGroupBy.apply() 在 func 的所有返回值都為 None 時返回完全為空的 DataFrame,而不是返回具有原始列和 dtype 的空 DataFrame 的錯誤 (GH 57775)

  • DataFrameGroupBy.apply() 在 as_index=False 時返回 MultiIndex 而不是 Index 的錯誤 (GH 58291)

  • DataFrameGroupBy.cumsum() 和 DataFrameGroupBy.cumprod() 中,numeric_only 引數透過 kwargs 間接傳遞而不是直接傳遞的錯誤 (GH 58811)

  • DataFrameGroupBy.cumsum() 在標籤包含 None 時未返回正確 dtype 的錯誤 (GH 58811)

  • DataFrameGroupBy.groups() 和 SeriesGroupBy.groups() 不遵守 groupby 引數 dropna 的錯誤 (GH 55919)

  • DataFrameGroupBy.groups() 和 SeriesGroupBy.groups() 在組是包含 NA 值的 Categorical 時失敗的錯誤 (GH 61356)

  • DataFrameGroupBy.median() 中 NaT 值導致結果不正確的錯誤 (GH 57926)

  • DataFrameGroupBy.quantile() 在 interpolation="nearest" 時與 DataFrame.quantile() 不一致的錯誤 (GH 47942)

  • DataFrameGroupBy.sum() 和 SeriesGroupBy.sum() 在溢位時返回 NaN 的錯誤。現在這些方法在溢位時返回 inf 或 -inf (GH 60303)

  • DataFrameGroupBy.transform() 和 SeriesGroupBy.transform() 在使用 reducer 和 observed=False 時,當存在未觀察到的類別時,會將 dtype 強制轉換為 float 的錯誤 (GH 55326)

  • Resampler.asfreq() 在具有 origin 的固定頻率索引時忽略對齊並返回錯誤值的錯誤。現在 origin 和 offset 會被尊重 (GH 62725)

  • Resampler.interpolate() 在具有非均勻取樣和/或索引與結果重取樣索引不對齊的 DataFrame 上時,會導致錯誤的插值的錯誤 (GH 21351)

  • Rolling.apply() 在 method="table" 時,由於列預設按排序,未保留列順序的錯誤 (GH 59666)

  • Rolling.apply() 在 method="table" 時,應用於函式的週期數可能少於 min_period 的錯誤 (GH 58868)

  • Rolling.sem() 由於除以 sqrt((n - 1) * (n - ddof)) 而不是 sqrt(n * (n - ddof)),導致計算結果不正確的錯誤 (GH 63180)

  • Series.rolling() 與 BaseIndexer 子類一起使用並計算 min/max 時出錯的錯誤 (GH 46726)

  • DataFrame.ewm() 和 Series.ewm() 在 passed times 和非 mean 的聚合函式時的錯誤 (GH 51695)

  • DataFrame.resample() 和 Series.resample() 在索引具有 ArrowDtype 時間戳 dtype 時,未能保留索引名稱的錯誤 (GH 61222)

  • DataFrame.resample() 在 DataFrame 為空並使用 upsample 方法時,將索引型別更改為 MultiIndex 的錯誤 (GH 55572)

  • Rolling.skew() 和 Rolling.kurt() 由於數值不穩定性,在視窗跟隨異常值時錯誤地計算偏度和峰度(分別)的錯誤。現在計算會透過重新計算受影響的視窗來正確處理災難性取消 (GH 47461, GH 61416)

  • Rolling.skew() 和 Rolling.kurt() 在結果與輸入長度變化但資料和視窗內容相同的情況下,結果出現差異的錯誤 (GH 54380)

  • Series.resample() 在日期範圍結束於不存在的時間點之前不久時可能引發錯誤的錯誤 (GH 58380)

  • Series.resample() 在對非納秒解析度進行越界重取樣(納秒精度)時引發錯誤的錯誤 (GH 57427)

  • Rolling.var() 和 Rolling.std() 由於數值不穩定性而計算結果不正確的錯誤 (GH 47721, GH 52407, GH 54518, GH 55343)

  • DataFrame.groupby() 方法在操作 NumPy 可空資料時,當 NA 掩碼不是 C 連續時失敗的錯誤 (GH 61031)

  • DataFrame.groupby() 在按 Series 分組,並且該 Series 在呼叫 DataFrame.groupby() 後但在 groupby 操作之前被修改時出現錯誤的 (GH 63219)

  • DataFrame.groupby() 使用 TimeGrouper(例如 pd.Grouper(freq="D"))時,未能保留 PyArrow 索引 dtype 的錯誤 (GH 63518)

Reshaping#

  • concat() 在混合整數和布林 dtype 時,錯誤地將布林值轉換為整數的錯誤 (GH 45101)

  • qcut() 在分位數邊界處的值可能被錯誤分配的錯誤 (GH 59355)

  • DataFrame.combine_first() 未保留列順序的錯誤 (GH 60427)

  • DataFrame.combine_first() 在具有非唯一列時錯誤地引發異常的錯誤 (GH 29135)

  • DataFrame.combine() 在具有非唯一列時錯誤地引發異常的錯誤 (GH 51340)

  • DataFrame.explode() 對 pyarrow.large_list 型別產生錯誤結果的錯誤 (GH 61091)

  • DataFrame.join() 在不一致地設定結果索引名稱的錯誤 (GH 55815)

  • DataFrame.join() 在與 Series/DataFrames 列表進行連線時,未產生正確的行順序的錯誤 (GH 62954)

  • DataFrame.join() 在 DataFrame 具有 MultiIndex 且 MultiIndex.names 包含 None 時引發 AssertionError 的錯誤 (GH 58721)

  • DataFrame.merge() 在按僅包含 NaN 值的列進行合併時,導致陣列越界訪問的錯誤 (GH 59421)

  • Series.combine_first() 錯誤地將 None 條目替換為 NaN 的錯誤 (GH 58977)

  • DataFrame.unstack() 在 sort=False 時產生錯誤結果的錯誤 (GH 54987, GH 55516)

  • DataFrame.unstack() 在索引包含 NaN 且 sort=False 時引發錯誤的錯誤 (GH 61221)

  • DataFrame.merge() 在 Windows 上合併兩個 intc 或 uintc 型別的 DataFrame 時出現錯誤的 (GH 60091, GH 58713)

  • DataFrame.pivot_table() 在未提供 index 引數時,錯誤地對結果進行了子聚合(GH 58722)

  • DataFrame.pivot_table() 在同時提供 values 引數給 index 或 columns 引數時,錯誤地忽略了 values 引數(GH 57876, GH 61292)

  • DataFrame.pivot_table() 的 margins=True 在明確傳遞 dropna=False 時,沒有正確包含索引或列中具有 NaN 值的組(GH 61509)

  • DataFrame.stack() 在 future_stack=True 時,當 level=[] 時引發 ValueError 的錯誤(GH 60740)

  • DataFrame.unstack() 在處理具有 ExtentionDtype 的空 DataFrame 時,產生錯誤結果(GH 59123)

  • concat() 在將 DataFrame 和 Series 與 ignore_index=True 連線時,會丟失 Series 的名稱(GH 60723, GH 56257)

  • melt() 在 id_vars 中包含重複列名時,引發了誤導性的 AttributeError(GH 61475)

  • DataFrame.merge() 在同時指定 right_on 和 right_index 時,如果也指定了 left_on,則沒有引發 MergeError。現在這種情況會引發 MergeError。(GH 63242)

  • DataFrame.merge() 在使用者提供的字尾可能導致生成的名稱與現有列匹配從而產生重複列名的情況下,現在會引發 MergeError。(GH 61402)

  • DataFrame.merge() 在與 CategoricalDtype 列一起使用時,錯誤地引發了 RecursionError(GH 56376)

  • DataFrame.merge() 在使用 float32 索引時,錯誤地將索引轉換為 float64(GH 41626)

Sparse#

  • SparseDtype 在與 na fill value 進行相等比較時存在錯誤。(GH 54770)

  • DataFrame.sparse.from_spmatrix() 在某些子型別中硬編碼了無效的 fill_value。(GH 59063)

  • DataFrame.sparse.to_dense() 忽略了子類化,總是返回 DataFrame 例項(GH 59913)

  • SparseArray.cumsum() 在處理整數資料時,導致最大遞迴深度錯誤。(GH 62669)

ExtensionArray#

  • arrays.ArrowExtensionArray.__setitem__() 在使用具有重複值的整數陣列作為鍵時,行為不正確(GH 58530)

  • ArrowExtensionArray.factorize() 在輸入是字典編碼時,即使 dropna 設定為 False,也會丟棄 NA 值(GH 60567)

  • NDArrayBackedExtensionArray.take() 在使用整數陣列呼叫時,產生 dtype 與底層資料不匹配的陣列(GH 62448)

  • api.types.is_datetime64_any_dtype() 在自定義 ExtensionDtype 物件上,對於 array-like 會返回 False(GH 57055)

  • Arrow 支援的持續時間和時間戳的縮減(例如 sum、min、max、median、mean)在解析度不是納秒時,錯誤地返回 stdlib datetime 物件,而不是 Timedelta 和 Timestamp。(GH 63170)

  • ArrowDtype 物件與不相容型別(例如字串 vs 布林值)的比較,錯誤地引發異常,而不是返回全 False(對於 ==)或全 True(對於 !=)(GH 59505)

  • 在 PyArrow 未安裝時,透過 dtype 字串加上 "[pyarrow]" 來構造 pandas 資料結構,會引發 NameError 而不是 ImportError(GH 57928)

  • 各種 DataFrame 縮減操作在 pyarrow 時間型別中,當結果為 null 時,返回了錯誤的 dtype(GH 59234)

  • 在傳遞 fill_value 時,ExtensionArray 運算元之間的 flex arithmetic 出現錯誤。(GH 62467)

Styler

  • Styler.to_latex() 在樣式化列標題並結合隱藏索引或隱藏索引級別時存在的問題已修復。

其他#

  • DataFrame 在傳遞包含 NA 標量和 columns 的 dict 時,總是返回 np.nan(GH 57205)

  • Series 在嘗試將 Series 輸入資料轉換為給定 dtype 時,忽略了錯誤(GH 60728)

  • eval() 在 ExtensionArray 上執行除法 / 操作時,由於 TypeError 而失敗。(GH 58748)

  • eval() 在對二進位制操作(如 (x + y).dropna())進行方法呼叫時,引發了 AttributeError: 'BinOp' object has no attribute 'value'(GH 61175)

  • eval() 在使用 engine="numexpr" 時,未保留 Series 的名稱。(GH 10239)

  • eval() 在使用 engine="numexpr" 時,浮點除法返回了意外的結果。(GH 59736)

  • to_numeric() 在 arg 為 Timedelta 或 Timestamp 標量時,引發了 TypeError。(GH 59944)

  • unique() 在 Index 上時,不總是返回 Index。(GH 57043)

  • DataFrame.apply() 在傳遞 func=list[int] 時,引發了 RecursionError。(GH 61565)

  • DataFrame.apply() 在傳遞 engine="numba" 時,忽略了傳遞給應用函式的 args(GH 58712)

  • DataFrame.eval() 和 DataFrame.query() 在使用 @ 符號表示法透過 NumPy 屬性(例如,df.eval("@np.floor(a)"))時,導致了異常。(GH 58041)

  • DataFrame.eval() 和 DataFrame.query() 不支援使用 tan 函式。(GH 55091)

  • DataFrame.groupby() 在使用 None 值進行過濾時存在問題(GH 62501)

  • DataFrame.query() 在使用重複列名時導致了 TypeError。(GH 59950)

  • DataFrame.query() 在表示式包含反引號括起來的包含雜湊字元 #、反引號或不在 ASCII 範圍內的字元(U+0001..U+007F)的列名時,會引發異常或產生錯誤的結果。(GH 59285)(GH 49633)

  • DataFrame.query() 在使用反引號查詢整數列名時,會引發異常。(GH 60494)

  • DataFrame.rename() 和 Series.rename() 在傳遞的 mapper、index 或 columns 引數是具有非唯一 ser.index 的 Series 時,會產生損壞的結果而不是引發 ValueError。(GH 58621)

  • DataFrame.sample() 在 replace=False 且 (n * max(weights) / sum(weights)) > 1 的情況下,會返回有偏差的結果。現在會引發 ValueError。(GH 61516)

  • DataFrame.shift() 在沒有列的 DataFrame 上傳遞 freq 時,索引未正確移動。(GH 60102)

  • DataFrame.sort_index() 在傳遞 axis="columns"、ignore_index=True 和 ascending=False 時,未返回 RangeIndex 列。(GH 57293)

  • DataFrame.sort_values() 在按顯式命名為 None 的列排序時,引發了 KeyError,而不是按預期排序。(GH 61512)

  • DataFrame.transform() 返回的順序不正確,除非索引是單調遞增的。(GH 57069)

  • DataFrame.where() 在使用非布林型別陣列時,返回了 ValueError 而不是 TypeError(GH 56330)

  • Index.sort_values() 在傳遞將值轉換為元組的鍵函式(例如 key=natsort.natsort_key)時,會引發 TypeError(GH 56081)

  • Series.describe() 在傳遞 percentiles 引數時,始終包含中位數百分位數。(GH 60550)。

  • Series.diff() 允許 periods 引數接收非整數值。(GH 56607)

  • Series.dt() 在 ArrowDtype 中使用時,方法返回了不正確的值。(GH 57355)

  • Series.isin() 在 Series 較大(>10**6)且 values 包含 NA 時,引發了 TypeError(GH 60678)

  • Series.kurt() 和 Series.skew() 在低方差陣列上結果為零(GH 57972)

  • Series.list() 訪問器方法未保留原始 Index。(GH 58425)

  • Series.list() 訪問器方法未保留原始名稱。(GH 60522)

  • Series.map() 在使用 timestamp[pyarrow] dtype 或 duration[pyarrow] dtype 時,錯誤地返回了全 NaN 條目(GH 61231)

  • Series.mode() 在對具有可空型別且 series 中沒有 null 值的 Series 取模式時,引發了異常。(GH 58926)

  • Series.rank() 在 na_option='keep' 時,未保留可空整數的缺失值。(GH 56976)

  • Series.replace() 和 DataFrame.replace() 在 regex=True 且所有值都為 NA 時,丟擲了 ValueError。(GH 60688)

  • Series.replace() 在 Series 從 Index 建立且啟用了 Copy-On-Write 時存在問題(GH 61622)

  • Series.to_string() 在 series 包含帶有指數的複數浮點數時存在問題(GH 60405)

  • DataFrame Interchange Protocol 實現,在字串和日期時間列的資料緩衝區相關 dtype 時,返回了不正確的結果(GH 54781)

  • DataFrame、Series 和 Index 的 divmod 和 rdivmod 操作,在 bool dtypes 上未能引發異常,這與 __floordiv__ 的行為不一致(GH 46043)

  • 列印包含儲存在 DataFrame.attrs 中的 DataFrame 的 DataFrame 時,引發了 ValueError(GH 60455)

  • 列印包含儲存在 Series.attrs 中的 DataFrame 的 Series 時,引發了 ValueError(GH 60568)

  • 在對 DataFrame 或 Series 呼叫 copy.copy() 時,返回的是深複製而不是淺複製(GH 62971)

  • Series.rank() 在物件 dtype 和極小的浮點值情況下存在的問題已修復。(GH 62036)

  • DataFrame 建構函式錯誤地將帶有 .name 屬性的 array-like 物件分類為 Series 或 Index 的問題已修復(GH 61443)

  • 訪問 DataFrame 或 Series 的底層 NumPy 陣列時,如果陣列與原始 DataFrame 或 Series 共享資料,則會返回一個只讀陣列(只讀 NumPy 陣列)。此邏輯已透過 .array(或根據 dtype 不同而為 .values)擴充套件到訪問底層的 pandas ExtensionArray(GH 61925)。

貢獻者#

共有 729 人為本次釋出貢獻了補丁。名字旁邊有“+”號的人是第一次貢獻補丁。

  • 121238257 +

  • 3w36zj6 +

  • ADITYA KUSHWAHA +

  • ADITYA V J +

  • Abby VeCasey +

  • Abdulaziz Aloqeely

  • Abel Sanchez +

  • Abel Tavares +

  • Abhijit Chakraborty +

  • Abhinav +

  • Abhinav Reddy +

  • Abhinav Thimma +

  • Abhishek Chaudhari +

  • Abkari Mohammed Sayeem +

  • Aditya Ghosh +

  • Aditya Jha +

  • Aditya060 +

  • Agriya Khetarpal +

  • Ahmed Khairy +

  • Aidan Feldman

  • Aidos Kanapyanov

  • Akashisang +

  • Akshay Jain +

  • Albert Villanova del Moral

  • Alex

  • Alex Malins

  • Alexey Murz Korepov +

  • Alfredo Carella +

  • Alp +

  • Aman Sharma +

  • Amey Shinde +

  • Amin Allahyar +

  • Amir +

  • Amy Fung +

  • AnaDenisa +

  • Anand Mukherjee +

  • Andre Correia +

  • AndreyKolomiets +

  • André +

  • Andy

  • Angela Liss +

  • Aniket

  • Animcogn +

  • Anish Karki +

  • Anish Karthik +

  • Ankit Dhokariya +

  • Annika +

  • Anthony Speicher +

  • Antonio Valentino +

  • Antriksh006 +

  • Anurag Varma +

  • Aokizy2 +

  • Apoorv +

  • Arthur Laureus Wigo +

  • Arthur Wigo +

  • Artur Kenzo Obara Kawazoe +

  • Aryn1102 +

  • Ashar Khan +

  • Asish Mahapatra

  • Augustus +

  • Austin +

  • Austin Rhodes +

  • AustinOregonState +

  • Axeldnahcram +

  • Benjamin M +

  • Biplav Barua +

  • Borja Elizalde +

  • Brandon Norton +

  • Brandon Xu +

  • BreezeLune +

  • Brett Dixon +

  • Brian Christian +

  • Brian M +

  • Caden Gobat +

  • CaesarTY +

  • Carlo Barth +

  • Carson Fox +

  • Chaarvi Bansal +

  • ChiLin Chiu

  • Chris

  • Chris Hewitt +

  • Chris Xiang +

  • Christian Bläul +

  • Christian Castro +

  • Christine P. Chai +

  • Christopher Horn, PhD +

  • Christopher Titchen +

  • Christopher Xiang +

  • Claude Opus 4.5 +

  • Cliff Kerr +

  • Clément Robert

  • Code_Blooded +

  • Connor Wallace +

  • Cornelius Roemer +

  • Cristiano Sampaio +

  • Cristina Yenyxe Gonzalez Garcia +

  • DL Lim +

  • Dan Lawson +

  • Danferno +

  • Daniel Pinto Salazar +

  • Daniel S +

  • Dave Bunten +

  • Dave Tapley +

  • David Carvalho +

  • David Krych

  • Davit Gyulnazaryan +

  • DaxServer +

  • Dea María Léon

  • Deekshita +

  • Deen-dot +

  • Deepak Kapila +

  • Deepak Saldanha +

  • Denis Karadaş +

  • Denis Matsiusheuski +

  • Derek M. Knowlton +

  • Dhruv B Shetty

  • Dinesh Dawonauth +

  • Dipanshi Bansal +

  • Divya Sharma +

  • Dmitry Korotaev +

  • Dominik Smrž +

  • Echedey Luis +

  • Eduard Akhmetshin +

  • Edward FANG +

  • Ehsan Totoni +

  • Elliott Sales de Andrade

  • EngSongYeong +

  • Enrico Massa +

  • Eric Brown +

  • Eric Chen +

  • Eric Larson +

  • Espoir Murhabazi +

  • Ethan V Van Hao +

  • Eve Loraine Nuñal +

  • Evgenii Mosikhin

  • Ewout ter Hoeven

  • FLOURA ANGEL +

  • Fandi Meng +

  • Fangchen Li

  • Farsidetfs +

  • Fawaz Ahmed +

  • Fidorc80 +

  • Flavia Y. Ouyang +

  • Florian Bourgey +

  • Florian Jetter

  • Francesco Bruzzesi +

  • Francisco Kurucz +

  • Frank +

  • French_Ball +

  • FuzzyParrabellum +

  • G Karthik Koundinya +

  • Gael Varoquaux +

  • GauravM +

  • Geeeeeene +

  • Gen Sato +

  • George He +

  • Georgina Scott +

  • Georgios Giannakoulias +

  • Georgios Malandrakis +

  • Gianluca Ficarelli

  • Gleb Khmyznikov +

  • Goutham Anand +

  • Gowtham Kumar K. +

  • Grant Garrett-Grossman +

  • Gregers Thomas Skat Rørdam +

  • Guilherme Martins Crocetti +

  • GuruprashanthKrishnakumar +

  • Hanxin Chen +

  • Hariharan P R +

  • Harini Krishnamurthy +

  • Harmen Stoppels +

  • Harsha Lakamsani +

  • Harshit Pande +

  • Hassan Rad +

  • Henry Cuzco +

  • HeoHeo +

  • Hongxu Jia +

  • Hridey Marwah +

  • Huanghz2001

  • Huilin Xu +

  • HuilinXu +

  • HulusiOzy +

  • Ian Thompson +

  • Iaroslav Igoshev +

  • Icaro Alves +

  • Ilya +

  • Ingo Stallknecht +

  • Irv Lustig

  • Isaac Virshup

  • Isuru Fernando

  • Ivruix +

  • JBurley +

  • JHM Darbyshire

  • JJLLWW +

  • Jack +

  • Jack Shewring +

  • JackCollins1991 +

  • JackCollins91

  • Jacob Eggerd +

  • Jacob Lazar +

  • Jake Thomas Trevallion

  • Jakob Zahn +

  • Jakub Błażejowski +

  • Jakub Raczyński +

  • Jakub Szkliniarz +

  • James Bourbeau

  • James Spencer

  • James Yuill +

  • Janez Demšar +

  • JaniceP +

  • Jason Mok +

  • Javier Marin Tur +

  • Jay

  • Jay Ahn +

  • Jayalakshmi M +

  • Jean K. +

  • Jeff Harrison +

  • Jennifer Benson +

  • Jeremy Tuloup

  • Jesse +

  • Jixun Sun +

  • John Hendricks +

  • John Paul Feliciano +

  • Jonas Bergner +

  • Jonathan Marriott +

  • Jonathan Reimer +

  • Jordan Murphy +

  • Joren Hammudoglu +

  • Joris Van den Bossche

  • Joseph Kleinhenz +

  • Josquin Larsen +

  • José Morales +

  • JuanCarlos3 +

  • Julian Harbeck +

  • Julian-Harbeck +

  • Julien Palard

  • JulienBacquart +

  • Justine Wezenaar +

  • Kamel Gazzaz +

  • Karen Javadyan +

  • Karl Tarbet +

  • Katsia +

  • Kei +

  • KeiOshima +

  • Kevin Amparado

  • Kevin Doshi +

  • Kevin Sheppard

  • Kevon Scott +

  • Khemkaran

  • Khemkaran Sevta

  • Khor Chean Wei

  • Kian Eliasi

  • Kiril Isakov +

  • Kirill +

  • Konstantin Malanchev +

  • Korotaev DV +

  • Kunal Jani +

  • Kushagr Arora +

  • LOCHAN PAUDEL

  • Lakshman +

  • Lakshya Upadhyaya +

  • Laurent Mutricy

  • Laurie O

  • Leo Gordon +

  • Lex Lei +

  • Li +

  • Lirong +

  • Lobna Allam +

  • Loic Diridollou

  • Lonercode +

  • Louis Maddox +

  • Loïc Estève

  • Lu Yibo +

  • Luke Manley

  • Lysandros Nikolaou

  • Maaz Bin Asif +

  • Maitrey Talware +

  • Mangesh Kashid +

  • Manish Ranjan Karna +

  • Manjunath L +

  • Manlai Amar +

  • Marc Garcia

  • Marc Jones +

  • Marc Mueller

  • Marco Aurélio A. Barbosa +

  • Marco Barbosa +

  • Marco Edward Gorelli

  • Marco Gorelli

  • MarcoGorelli

  • Maren Westermann

  • Maria Ivanova +

  • Mark Akritas +

  • Mark Bekooy +

  • Mark Ryan +

  • Martin Braquet +

  • Mateusz Sokół

  • Matt Braymer-Hayes

  • Matt Delengowski +

  • Matt Heeter +

  • Matt Page +

  • Matt Popovich +

  • Matteo Paltenghi +

  • Matthew Heguy +

  • Matthew Pak +

  • Matthew Roeschke

  • Matthew Simpson +

  • Matthieu Thiboust +

  • Maushumee +

  • Maximilian Nicholson +

  • Meet_Vasita +

  • Memoona Shah +

  • Michael

  • Michael Hu +

  • Michael Moyles +

  • Michael Vincent Mannino +

  • Michaël Defferrard +

  • Michał Górny

  • Michelino Gali +

  • Michiel De Muynck +

  • Mien (Josephine) Nguyen +

  • Miguel Cárdenas +

  • Mika Allert +

  • Mike Perrone +

  • Mohammad Ahmadi

  • Moshe Kaplan +

  • Movsisyan +

  • Myles Scolnick +

  • Naresh Kumar +

  • Natalia Mokeeva

  • Natalie Dettmer +

  • Nathan Goldbaum

  • Navya Srivastava +

  • NewUserHa +

  • Nick Crews

  • Nikhil +

  • Niklas Rousset +

  • Niruta Talwekar +

  • Nithurshen +

  • Nitish Satyavolu +

  • Noa Tamir

  • Noah Asing +

  • Nrezhang +

  • Olivier H. +

  • PRANAV +

  • Parthava Adabala +

  • Parthi

  • Pascal Brochart +

  • Pascal Corpet +

  • Patrick Hoefler

  • Paul

  • Paul Behrisch +

  • Paul Bissex +

  • Paulo S. Costa

  • Pedro Diogo +

  • Pedro Freitas +

  • Pedro Marques +

  • Pedro Santos +

  • PenguinPen +

  • Peter Nguyen +

  • Peter Westling +

  • Petroncini +

  • Philipp Hoffmann +

  • Pol Rius +

  • Praateek Mahajan +

  • Pranav Raghu +

  • Pranav Wadhwa +

  • Prathamesh +

  • Preetham Yerragudi +

  • Qaiser Abbasi +

  • Quang Nguyễn

  • Quentin Lhoest +

  • Rafael Fontenelle +

  • Raffi Enficiaud +

  • Rajvi Gemawat +

  • Ralf Gommers

  • Randolf Scholz

  • Richard Howe +

  • Richard Shadrach

  • Ritoban Dutta +

  • Ritwiz Sinha +

  • Rob

  • Robert Schmidtke

  • Robert Utterback +

  • Robert Wolff +

  • Robin

  • Robin Mader +

  • Robin Shindelman +

  • Rohan Jain

  • Roline Stapny Saldanha +

  • Ron Arbo +

  • Rui Amaral +

  • Ruifeng Zheng +

  • Rustam Ali +

  • Rutrum +

  • S +

  • SAHARSH TIBREWALA +

  • SALCAN

  • Saadha Salim +

  • Sam Baumann +

  • Samuel +

  • Samuel Chai

  • Samuel Oranyeli

  • Samuel Xavier +

  • Sanchit Rishi +

  • SanchitD +

  • Sangam Paudel +

  • Sanjana Moudgalya +

  • Santhosh Kumar Bethi +

  • Saraswathy Kalaiselvan +

  • Sathvik Mulukutla +

  • Scott Talbert

  • Sebastian Berg

  • Sebastian Correa +

  • SebastianOuslis +

  • Sergey B Kirpichev +

  • Sergio Livi +

  • Shabab Karim

  • Shashwat Agrawal

  • ShaunSrirangam +

  • Shawn Liu +

  • Shi Entong +

  • Shing Chan +

  • Shmulik Cohen +

  • Shreyal Gupta +

  • Shreyas +

  • Shubham Sarkar +

  • Shubhang Sinha +

  • Shubhank Gyawali +

  • Shubhankar Agrawal +

  • Siddhesh Bangar +

  • SiemBerhane +

  • Simon Hawkins

  • Sinclair Hudson +

  • Sivasweatha Umamaheswaran +

  • Sofia Soares +

  • Sparsh Sah +

  • Sreeja Govardhana +

  • Srinitya Kondapally +

  • Stefano Silvestri +

  • Steffen Rehberg

  • Stepfen Shawn

  • Steven Schaerer

  • SubsequentlySneeds +

  • Suhrid Singh +

  • Sukriti +

  • Sumeet Bhatnagar +

  • Swati Sneha +

  • T. Koskamp +

  • TJ +

  • Tal yahav +

  • Tanya Bouman +

  • TechnoShip123 +

  • Tejas Rajput +

  • Tejaswini V +

  • TessAfanasyeva +

  • Thad Guidry +

  • Thai Villaluna +

  • Thanh Lam DANG +

  • Thanh Le-Cong +

  • Thi PHAN +

  • Thierry Moisan

  • Thomas A Caswell

  • Thomas Baumann

  • Thomas Dixon +

  • Thomas H

  • Thomas Heavey

  • Thomas Holder +

  • Thomas Li

  • Thomaz +

  • Thomaz Miranda +

  • Thummalapalli Sai Teja Sri Sanjana +

  • Tiffany Xiao +

  • Tilova Shahrin +

  • Tim Hoffmann

  • Tim Smith +

  • Tim Sweña (Swast) +

  • Tim Yang

  • Tirthraj Parmar +

  • Tolker-KU

  • Tom Augspurger

  • Tomaz Silva +

  • Tonow +

  • Torsten Wörtwein

  • Trevor Serrao +

  • Trinh Quoc Anh

  • Tristan Koskamp +

  • Tuhin Sharma +

  • Tunahan Yardımcı +

  • Tyson Cung +

  • U-S-jun +

  • UDIT BALIYAN +

  • UV +

  • Udit Baliyan +

  • Ulrich Dobramysl +

  • VISWESWARAN1998 +

  • Valentin Iovene

  • Veit Heller +

  • Venkat +

  • Venkata Akhil Mettu +

  • Vibavari Gurunathan +

  • Vignesh Iyer +

  • Vijay Sarathy +

  • Vikram Kumar +

  • Vineet Kumar +

  • Vishal Shivam +

  • Viswa Sai Ammiraju Bonam +

  • Vladimir Fokow

  • Vrashank Shetty +

  • W. H. Wang +

  • Wang Haoxiang +

  • Wei-Hsiang (Matt) Wang +

  • Wes Turner

  • WhimsyHippo +

  • Will Sorenson +

  • William Andrea

  • William Ayd

  • William Joshua King +

  • William King +

  • Winnie +

  • Wong2333 +

  • Work +

  • XY +

  • Xiao Yuan

  • Y.X +

  • Yana Mishula +

  • Yashpal Ahlawat +

  • Yassin Abdelghany +

  • Yaswanth Kumar +

  • Yi-Fan Wang +

  • Yi-Han Chen +

  • Yinon Horev +

  • YinonHorev +

  • Yoshimu U. Nats +

  • Yuki Kitayama

  • Yuki Kobayashi +

  • Yuri Batista Ishizawa +

  • Yuvraj Pradhan +

  • ZA1815 +

  • ZKaoChi +

  • Zachary Collins +

  • Zanir Pirani +

  • ZanirP +

  • Zephy +

  • Zhengbo Wang

  • Zorex Salvo +

  • Zrahay +

  • [Annika Rudolph] +

  • aBiR1D +

  • aaron-robeson-8451

  • aaronchucarroll +

  • abonte

  • ahmedbektic +

  • aimlnerd +

  • amansharma612 +

  • ammar-qazi +

  • ananiavito +

  • anishkarki +

  • anzber +

  • aokizy +

  • aram-cinnamon

  • asoledad33 +

  • auderson

  • avecasey +

  • averagejoy +

  • avm19 +

  • aydinkhan2005 +

  • bdwzhangumich +

  • benjamindonnachie +

  • bluestarunderscore +

  • callumfrederiksen +

  • calvin +

  • chaoyihu +

  • chen +

  • chi +

  • cloudboat +

  • cmjcharlton +

  • cmp0xff +

  • cristian_scobioala +

  • dajale423 +

  • datapythonista +

  • davidesquer +

  • dependabot[bot]

  • devin-ai-integration[bot] +

  • dkane01 +

  • droussea2001 +

  • dshettyepi +

  • dsousa +

  • easternsun7 +

  • eicchen +

  • eicchen02 +

  • eightyseven +

  • eilonc-cx +

  • ellaella12 +

  • ensalada-de-pechuga +

  • er-eis +

  • erichxchen +

  • eshaready +

  • fatslow +

  • gabuzi +

  • gameofby +

  • gboeker +

  • hafeja +

  • haffara +

  • harinik +

  • huhu +

  • huisman +

  • hye ryung cho +

  • iangainey +

  • ianlv +

  • igeni +

  • imTejasRajput +

  • invain01 +

  • invalidarg +

  • ivanpan0626 +

  • ivonastojanovic +

  • jad +

  • james-magee +

  • jarent-nvidia +

  • jayendhargautham +

  • jbrockmendel

  • jeffersbaxter +

  • jeffery nosakhare Omorodion +

  • jeffreykenneth +

  • jerrywbirnbaum +

  • jgao8 +

  • jl_win_a +

  • jmalp +

  • jmarin +

  • johnff9 +

  • johnpaulfeliciano98 +

  • johnyu013 +

  • jrmylow +

  • justmhie +

  • jzwick +

  • karnbirrandhawa +

  • koushik-rout-samsung +

  • kpvenkat47 +

  • krishna datta +

  • ktseng4096 +

  • lamprinikourou +

  • lfffkh +

  • lif +

  • llayague +

  • mateomramos +

  • matiaslindgren +

  • matsidzi +

  • mattbest +

  • mazhar996 +

  • messense +

  • microslaw +

  • mikkas456 +

  • morotti

  • mroeschke * DOC: fix example for iv_idx.left * Implement test for GH #21340 * minor fixup * Lint contribution * Make spacing consistent * Lint * Remove duplicate column construction * Avoid DeprecationWarning by setting include_groups=False in apply ——— Co-authored-by: Jason Mok +

  • mroeschke +

  • musvaage +

  • mutricyl +

  • myenugula +

  • ncknelson +

  • ofsouzap +

  • omahs +

  • ooo oo +

  • pandas Development Team

  • partev

  • paul +

  • pedrocariellof +

  • pre-commit-ci[bot]

  • ptth222

  • r0rshark +

  • rdzantoine.pro@gmail.com +

  • renanffernando +

  • rhshadrach

  • richard +

  • ritwika314 +

  • rmorotti +

  • rohanjain101

  • root +

  • s1099 +

  • sah0725 +

  • santhoshbethi +

  • sdhjebngc +

  • sharkipelago +

  • shriyakalakata +

  • sjalkote +

  • skalwaghe_56 +

  • sliuos +

  • sooooooing +

  • specialkapa +

  • sshu2017 +

  • steeleelliott03 +

  • stevenae +

  • sunlight +

  • surenpoghosian +

  • suzyahyah +

  • taranarmo +

  • tasfia8

  • tharun-mk +

  • thetestspecimen +

  • thomasdamcevski +

  • thwait +

  • tisjayy +

  • tomas-cc +

  • u7397058 +

  • undermyumbrella1 +

  • v-lozko +

  • veljanin +

  • viable-alternative +

  • wanglc02 +

  • wdyy20041223 +

  • wenchen-cai +

  • william larkin +

  • wooseogchoi +

  • wysiwyg +

  • xiaohuanlin +

  • xingyubobo33333 +

  • xxx.Yan +

  • yashb

  • yjennyli +

  • yokomotod +

  • zachyattack23 +

  • zhan7236 +

  • zhiqiangxu +

  • zishan044 +

  • zjweiss-google +

  • zslsally +

  • Álvaro Kothe

  • Óscar Gómez +

  • 張博聞 +

  • 許知恆 +

  • 🍌Shawn +