2.0.0 版本新增內容 (2023 年 4 月 3 日)#

以下是 pandas 2.0.0 版本中的更改。有關包括其他 pandas 版本在內的完整更改日誌,請參閱 發行說明

增強功能#

使用 pip extras 安裝可選依賴項#

使用 pip 安裝 pandas 時,還可以透過指定 extras 來安裝可選依賴項集。

pip install "pandas[performance, aws]>=2.0.0"

安裝指南 中可以找到可用 extras,它們是 [all, performance, computation, fss, aws, gcp, excel, parquet, feather, hdf5, spss, postgresql, mysql, sql-other, html, xml, plot, output_formatting, clipboard, compression, test] (GH 39164)。

Index 現在可以包含 numpy 數值 dtype#

現在可以在 Index 中使用任何 numpy 數值 dtype (GH 42717)。

之前只能使用 int64uint64float64 dtype

In [1]: pd.Index([1, 2, 3], dtype=np.int8)
Out[1]: Int64Index([1, 2, 3], dtype="int64")
In [2]: pd.Index([1, 2, 3], dtype=np.uint16)
Out[2]: UInt64Index([1, 2, 3], dtype="uint64")
In [3]: pd.Index([1, 2, 3], dtype=np.float32)
Out[3]: Float64Index([1.0, 2.0, 3.0], dtype="float64")

Int64IndexUInt64IndexFloat64Index 在 pandas 1.4 版本中已被棄用,現已移除。現在應直接使用 Index,並且它可以接受所有 numpy 數值 dtype,即 int8/ int16/int32/int64/uint8/uint16/uint32/uint64/float32/float64 dtype

In [1]: pd.Index([1, 2, 3], dtype=np.int8)
Out[1]: Index([1, 2, 3], dtype='int8')

In [2]: pd.Index([1, 2, 3], dtype=np.uint16)
Out[2]: Index([1, 2, 3], dtype='uint16')

In [3]: pd.Index([1, 2, 3], dtype=np.float32)
Out[3]: Index([1.0, 2.0, 3.0], dtype='float32')

Index 能夠包含 numpy 數值 dtype 這一能力帶來了一些 pandas 功能上的變化。特別是,以前被迫建立 64 位索引的操作,現在可以建立具有較低位大小(例如,32 位索引)的索引。

以下是可能不詳盡的更改列表

  1. 使用 numpy 數值陣列進行例項化現在遵循 numpy 陣列的 dtype。以前,所有從 numpy 數值陣列建立的索引都被強制為 64 位。現在,例如,在 32 位系統上,Index(np.array([1, 2, 3])) 將為 int32,而之前即使在 32 位系統上也會是 int64。使用數字列表例項化 Index 仍將返回 64 位 dtype,例如 Index([1, 2, 3]) 將具有 int64 dtype,這與之前相同。

  2. 之前 DatetimeIndex 的各種數值日期時間屬性(daymonthyear 等)的 dtype 是 int64,而對於 arrays.DatetimeArray 則是 int32。現在對於 DatetimeIndex 也是 int32

    In [4]: idx = pd.date_range(start='1/1/2018', periods=3, freq='ME')
    
    In [5]: idx.array.year
    Out[5]: array([2018, 2018, 2018], dtype=int32)
    
    In [6]: idx.year
    Out[6]: Index([2018, 2018, 2018], dtype='int32')
    
  3. 來自 Series.sparse.from_coo() 的 Indexes 上的 Level dtypes 現在是 int32,與 scipy 稀疏矩陣上的 rows/cols 相同。以前是 int64 dtype。

    In [7]: from scipy import sparse
    
    In [8]: A = sparse.coo_matrix(
       ...:     ([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])), shape=(3, 4)
       ...: )
       ...: 
    
    In [9]: ser = pd.Series.sparse.from_coo(A)
    
    In [10]: ser.index.dtypes
    Out[10]: 
    level_0    int32
    level_1    int32
    dtype: object
    
  4. Index 不能使用 float16 dtype 進行例項化。以前使用 dtype float16 例項化 Index 會得到一個具有 float64 dtype 的 Float64Index。現在會引發 NotImplementedError

    In [11]: pd.Index([1, 2, 3], dtype=np.float16)
    ---------------------------------------------------------------------------
    NotImplementedError                       Traceback (most recent call last)
    Cell In[11], line 1
    ----> 1 pd.Index([1, 2, 3], dtype=np.float16)
    
    File ~/work/pandas/pandas/pandas/core/indexes/base.py:591, in Index.__new__(cls, data, dtype, copy, name, tupleize_cols)
        587 arr = ensure_wrapped_if_datetimelike(arr)
        589 klass = cls._dtype_to_subclass(arr.dtype)
    --> 591 arr = klass._ensure_array(arr, arr.dtype, copy=False)
        592 return klass._simple_new(arr, name, refs=refs)
    
    File ~/work/pandas/pandas/pandas/core/indexes/base.py:604, in Index._ensure_array(cls, data, dtype, copy)
        601     raise ValueError("Index data must be 1-dimensional")
        602 elif dtype == np.float16:
        603     # float16 not supported (no indexing engine)
    --> 604     raise NotImplementedError("float16 indexes are not supported")
        606 if copy:
        607     # asarray_tuplesafe does not always copy underlying data,
        608     #  so need to make sure that this happens
        609     data = data.copy()
    
    NotImplementedError: float16 indexes are not supported
    

引數 dtype_backend,用於返回 pyarrow 後備或 numpy 後備的可空 dtype#

以下函式新增了一個關鍵字引數 dtype_backend (GH 36712)

當此選項設定為 "numpy_nullable" 時,它將返回一個由可空 dtype 支援的 DataFrame

當此關鍵字設定為 "pyarrow" 時,這些函式將返回 pyarrow 後備的可空 ArrowDtype DataFrame (GH 48957, GH 49997)。

In [12]: import io

In [13]: data = io.StringIO("""a,b,c,d,e,f,g,h,i
   ....:     1,2.5,True,a,,,,,
   ....:     3,4.5,False,b,6,7.5,True,a,
   ....: """)
   ....: 

In [14]: df = pd.read_csv(data, dtype_backend="pyarrow")

In [15]: df.dtypes
Out[15]: 
a     int64[pyarrow]
b    double[pyarrow]
c      bool[pyarrow]
d    string[pyarrow]
e     int64[pyarrow]
f    double[pyarrow]
g      bool[pyarrow]
h    string[pyarrow]
i      null[pyarrow]
dtype: object

In [16]: data.seek(0)
Out[16]: 0

In [17]: df_pyarrow = pd.read_csv(data, dtype_backend="pyarrow", engine="pyarrow")

In [18]: df_pyarrow.dtypes
Out[18]: 
a     int64[pyarrow]
b    double[pyarrow]
c      bool[pyarrow]
d    string[pyarrow]
e     int64[pyarrow]
f    double[pyarrow]
g      bool[pyarrow]
h    string[pyarrow]
i      null[pyarrow]
dtype: object

寫時複製改進#

  • 寫時複製最佳化 中列出的方法中,添加了一個新的惰性複製機制,該機制會延遲複製操作,直到被操作的物件被修改為止。這些方法在啟用寫時複製時返回檢視,與常規執行相比,提供了顯著的效能提升 (GH 49473)。

  • 當啟用寫時複製時,訪問 DataFrame 的單個列作為 Series(例如 df["col"])現在每次構造時都始終返回一個新物件(而不是多次返回一個相同的、快取的 Series 物件)。這確保了這些 Series 物件正確遵循寫時複製規則 (GH 49450)。

  • 在從現有 Series 構造 Series 時(預設 copy=False),Series 建構函式現在將建立惰性副本(延遲複製直到資料發生修改)(GH 50471)。

  • 在從現有 DataFrame 構造 DataFrame 時(預設 copy=False),DataFrame 建構函式現在將建立惰性副本(延遲複製直到資料發生修改)(GH 51239)。

  • 在從 Series 字典構造 DataFrame 時並指定 copy=False 時,DataFrame 建構函式現在將對 DataFrame 的列使用這些 Series 物件的惰性副本 (GH 50777)。

  • 當從 SeriesIndex 構造 DataFrame 時並指定 copy=FalseDataFrame 建構函式現在將遵守寫時複製。

  • DataFrame 和 Series 建構函式在從 NumPy 陣列構造時,現在預設複製陣列,以避免在修改陣列時修改 DataFrame / Series。指定 copy=False 以獲得舊行為。當設定 copy=False 時,pandas 不保證在建立 DataFrame / Series 後修改 NumPy 陣列時的正確寫時複製行為。

  • DataFrame.from_records() 在與 DataFrame 呼叫時將遵守寫時複製。

  • 當啟用寫時複製時,使用鏈式賦值(例如 df["a"][1:3] = 0)設定值現在將始終引發警告。在此模式下,鏈式賦值永遠無法生效,因為我們總是對索引操作(getitem)的結果進行臨時物件設定,而在寫時複製下,它始終表現為複製。因此,透過鏈式進行賦值永遠無法更新原始 Series 或 DataFrame。因此,會向用戶發出一個資訊性警告,以避免默默無為 (GH 49467)。

  • DataFrame.replace()inplace=True 時將遵守寫時複製機制。

  • DataFrame.transpose() 現在將遵守寫時複製機制。

  • 可以原地進行的算術運算(例如 ser *= 2)現在將遵守寫時複製機制。

  • DataFrame 具有 MultiIndex 列時,DataFrame.__getitem__() 現在將遵守寫時複製機制。

  • Series擁有MultiIndex時,Series.__getitem__()現在將遵守寫時複製機制。

    Series擁有MultiIndex

  • Series.view() 現在將遵守寫時複製機制。

可以透過以下任一方式啟用寫時複製:

pd.set_option("mode.copy_on_write", True)
pd.options.mode.copy_on_write = True

或者,可以透過本地方式啟用寫時複製:

with pd.option_context("mode.copy_on_write", True):
    ...

其他增強功能#

重要的 bug 修復#

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

`DataFrameGroupBy.cumsum()` 和 `DataFrameGroupBy.cumprod()` 會溢位而不是有損地轉換為 float#

在之前的版本中,當應用 `cumsum` 和 `cumprod` 時,我們會將其轉換為 float,這會導致即使結果可以被 `int64` 資料型別容納,也會產生不正確的結果。此外,當達到 `int64` 的極限時,聚合溢位與 numpy 和常規的 `DataFrame.cumprod()` 和 `DataFrame.cumsum()` 方法一致 (GH 37493)。

舊行為

In [1]: df = pd.DataFrame({"key": ["b"] * 7, "value": 625})
In [2]: df.groupby("key")["value"].cumprod()[5]
Out[2]: 5.960464477539062e+16

我們在第 6 個值時返回了不正確的結果。

新行為

In [19]: df = pd.DataFrame({"key": ["b"] * 7, "value": 625})

In [20]: df.groupby("key")["value"].cumprod()
Out[20]: 
0                   625
1                390625
2             244140625
3          152587890625
4        95367431640625
5     59604644775390625
6    359414837200037393
Name: value, dtype: int64

我們在第 7 個值時溢位,但第 6 個值仍然是正確的。

`DataFrameGroupBy.nth()` 和 `SeriesGroupBy.nth()` 現在表現為過濾操作#

在之前的 pandas 版本中,`DataFrameGroupBy.nth()` 和 `SeriesGroupBy.nth()` 的行為就像它們是聚合操作一樣。然而,對於大多數 `n` 的輸入,它們可能每個組返回零行或多行。這意味著它們是過濾操作,類似於 `DataFrameGroupBy.head()`。pandas 現在將它們視為過濾操作 (GH 13666)。

In [21]: df = pd.DataFrame({"a": [1, 1, 2, 1, 2], "b": [np.nan, 2.0, 3.0, 4.0, 5.0]})

In [22]: gb = df.groupby("a")

舊行為

In [5]: gb.nth(n=1)
Out[5]:
   A    B
1  1  2.0
4  2  5.0

新行為

In [23]: gb.nth(n=1)
Out[23]: 
   a    b
1  1  2.0
4  2  5.0

特別是,結果的索引是從輸入中選擇適當的行派生出來的。另外,當 `n` 大於組時,返回零行而不是 `NaN`。

舊行為

In [5]: gb.nth(n=3, dropna="any")
Out[5]:
    B
A
1 NaN
2 NaN

新行為

In [24]: gb.nth(n=3, dropna="any")
Out[24]: 
Empty DataFrame
Columns: [a, b]
Index: []

向後不相容的 API 更改#

使用具有不受支援解析度的 datetime64 或 timedelta64 資料型別的構造#

在過去的版本中,當構造一個 `Series` 或 `DataFrame` 並傳遞具有不受支援解析度(即“ns”以外的任何解析度)的“datetime64”或“timedelta64”資料型別時,pandas 會默默地將給定的資料型別替換為其納秒級對應項。

先前行為:

In [5]: pd.Series(["2016-01-01"], dtype="datetime64[s]")
Out[5]:
0   2016-01-01
dtype: datetime64[ns]

In [6] pd.Series(["2016-01-01"], dtype="datetime64[D]")
Out[6]:
0   2016-01-01
dtype: datetime64[ns]

在 pandas 2.0 中,我們支援“s”、“ms”、“us”和“ns”解析度。傳遞支援的資料型別(例如“datetime64[s]”)時,結果現在具有精確請求的資料型別。

新行為:

In [25]: pd.Series(["2016-01-01"], dtype="datetime64[s]")
Out[25]: 
0   2016-01-01
dtype: datetime64[s]

對於不支援的資料型別,pandas 現在會引發異常而不是默默地交換支援的資料型別。

新行為:

In [26]: pd.Series(["2016-01-01"], dtype="datetime64[D]")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[26], line 1
----> 1 pd.Series(["2016-01-01"], dtype="datetime64[D]")

File ~/work/pandas/pandas/pandas/core/series.py:514, in Series.__init__(self, data, index, dtype, name, copy)
    512         data = data.copy(deep=True)
    513 else:
--> 514     data = sanitize_array(data, index, dtype, copy)
    515     data = SingleBlockManager.from_array(data, index, refs=refs)
    517 NDFrame.__init__(self, data)

File ~/work/pandas/pandas/pandas/core/construction.py:665, in sanitize_array(data, index, dtype, copy, allow_2d)
    662     subarr = np.array([], dtype=np.float64)
    664 elif dtype is not None:
--> 665     subarr = _try_cast(data, dtype, copy)
    667 else:
    668     subarr = maybe_convert_platform(data)

File ~/work/pandas/pandas/pandas/core/construction.py:839, in _try_cast(arr, dtype, copy)
    835         if arr.ndim == 2 and arr.shape[1] == 1:
    836             # GH#60081: DataFrame Constructor converts 1D data to array of
    837             # shape (N, 1), but maybe_cast_to_datetime assumes 1D input
    838             return maybe_cast_to_datetime(arr[:, 0], dtype).reshape(arr.shape)
--> 839     return maybe_cast_to_datetime(arr, dtype)
    841 # GH#15832: Check if we are requesting a numeric dtype and
    842 # that we can convert the data to the requested dtype.
    843 elif dtype.kind in "iu":
    844     # this will raise if we have e.g. floats

File ~/work/pandas/pandas/pandas/core/dtypes/cast.py:1095, in maybe_cast_to_datetime(value, dtype)
   1091     raise TypeError("value must be listlike")
   1093 # TODO: _from_sequence would raise ValueError in cases where
   1094 #  _ensure_nanosecond_dtype raises TypeError
-> 1095 _ensure_nanosecond_dtype(dtype)
   1097 if lib.is_np_dtype(dtype, "m"):
   1098     res = TimedeltaArray._from_sequence(value, dtype=dtype)

File ~/work/pandas/pandas/pandas/core/dtypes/cast.py:1152, in _ensure_nanosecond_dtype(dtype)
   1149     raise ValueError(msg)
   1150 # TODO: ValueError or TypeError? existing test
   1151 #  test_constructor_generic_timestamp_bad_frequency expects TypeError
-> 1152 raise TypeError(
   1153     f"dtype={dtype} is not supported. Supported resolutions are 's', "
   1154     "'ms', 'us', and 'ns'"
   1155 )

TypeError: dtype=datetime64[D] is not supported. Supported resolutions are 's', 'ms', 'us', and 'ns'

`value_counts` 將結果名稱設定為 `count`#

在過去的版本中,當執行 `Series.value_counts()` 時,結果會繼承原始物件的名稱,而結果索引是無名稱的。這會在重置索引時造成混淆,並且列名與列值不匹配。現在,結果名稱將是 `'count'`(如果傳遞了 `normalize=True`,則為 `'proportion'`),索引將以原始物件命名 (GH 49497)。

先前行為:

In [8]: pd.Series(['quetzal', 'quetzal', 'elk'], name='animal').value_counts()

Out[2]:
quetzal    2
elk        1
Name: animal, dtype: int64

新行為:

In [27]: pd.Series(['quetzal', 'quetzal', 'elk'], name='animal').value_counts()
Out[27]: 
animal
quetzal    2
elk        1
Name: count, dtype: int64

其他 `value_counts` 方法(例如,`DataFrame.value_counts()`)也類似。

禁止轉換為不支援的 datetime64/timedelta64 資料型別的 astype 轉換#

在以前的版本中,將 `Series` 或 `DataFrame` 從 `datetime64[ns]` 轉換為其他 `datetime64[X]` 資料型別時,會返回 `datetime64[ns]` 資料型別而不是請求的資料型別。在 pandas 2.0 中,添加了對“datetime64[s]”、“datetime64[ms]”和“datetime64[us]”資料型別的支援,因此轉換為這些資料型別將獲得精確請求的資料型別。

先前行為:

In [28]: idx = pd.date_range("2016-01-01", periods=3)

In [29]: ser = pd.Series(idx)

先前行為:

In [4]: ser.astype("datetime64[s]")
Out[4]:
0   2016-01-01
1   2016-01-02
2   2016-01-03
dtype: datetime64[ns]

在新行為下,我們獲得了精確請求的資料型別。

新行為:

In [30]: ser.astype("datetime64[s]")
Out[30]: 
0   2016-01-01
1   2016-01-02
2   2016-01-03
dtype: datetime64[s]

對於不受支援的解析度,例如“datetime64[D]”,我們會引發異常而不是默默忽略請求的資料型別。

新行為:

In [31]: ser.astype("datetime64[D]")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[31], line 1
----> 1 ser.astype("datetime64[D]")

File ~/work/pandas/pandas/pandas/core/generic.py:6541, in NDFrame.astype(self, dtype, copy, errors)
   6537     results = [ser.astype(dtype, errors=errors) for _, ser in self.items()]
   6539 else:
   6540     # else, only a single dtype is given
-> 6541     new_data = self._mgr.astype(dtype=dtype, errors=errors)
   6542     res = self._constructor_from_mgr(new_data, axes=new_data.axes)
   6543     return res.__finalize__(self, method="astype")

File ~/work/pandas/pandas/pandas/core/internals/managers.py:611, in BaseBlockManager.astype(self, dtype, errors)
    610 def astype(self, dtype, errors: str = "raise") -> Self:
--> 611     return self.apply("astype", dtype=dtype, errors=errors)

File ~/work/pandas/pandas/pandas/core/internals/managers.py:442, in BaseBlockManager.apply(self, f, align_keys, **kwargs)
    440         applied = b.apply(f, **kwargs)
    441     else:
--> 442         applied = getattr(b, f)(**kwargs)
    443     result_blocks = extend_blocks(applied, result_blocks)
    445 out = type(self).from_blocks(result_blocks, [ax.view() for ax in self.axes])

File ~/work/pandas/pandas/pandas/core/internals/blocks.py:607, in Block.astype(self, dtype, errors, squeeze)
    604         raise ValueError("Can not squeeze with more than one column.")
    605     values = values[0, :]  # type: ignore[call-overload]
--> 607 new_values = astype_array_safe(values, dtype, errors=errors)
    609 new_values = maybe_coerce_values(new_values)
    611 refs = None

File ~/work/pandas/pandas/pandas/core/dtypes/astype.py:240, in astype_array_safe(values, dtype, copy, errors)
    237     dtype = dtype.numpy_dtype
    239 try:
--> 240     new_values = astype_array(values, dtype, copy=copy)
    241 except (ValueError, TypeError):
    242     # e.g. _astype_nansafe can fail on object-dtype of strings
    243     #  trying to convert to float
    244     if errors == "ignore":

File ~/work/pandas/pandas/pandas/core/dtypes/astype.py:182, in astype_array(values, dtype, copy)
    178     return values
    180 if not isinstance(values, np.ndarray):
    181     # i.e. ExtensionArray
--> 182     values = values.astype(dtype, copy=copy)
    184 else:
    185     values = _astype_nansafe(values, dtype, copy=copy)

File ~/work/pandas/pandas/pandas/core/arrays/datetimes.py:764, in DatetimeArray.astype(self, dtype, copy)
    762 elif isinstance(dtype, PeriodDtype):
    763     return self.to_period(freq=dtype.freq)
--> 764 return dtl.DatetimeLikeArrayMixin.astype(self, dtype, copy)

File ~/work/pandas/pandas/pandas/core/arrays/datetimelike.py:514, in DatetimeLikeArrayMixin.astype(self, dtype, copy)
    510 elif (dtype.kind in "mM" and self.dtype != dtype) or dtype.kind == "f":
    511     # disallow conversion between datetime/timedelta,
    512     # and conversions for any datetimelike to float
    513     msg = f"Cannot cast {type(self).__name__} to dtype {dtype}"
--> 514     raise TypeError(msg)
    515 else:
    516     return np.asarray(self, dtype=dtype)

TypeError: Cannot cast DatetimeArray to dtype datetime64[D]

對於從 `timedelta64[ns]` 資料型別進行的轉換,舊的行為會轉換為浮點格式。

先前行為:

In [32]: idx = pd.timedelta_range("1 Day", periods=3)

In [33]: ser = pd.Series(idx)

先前行為:

In [7]: ser.astype("timedelta64[s]")
Out[7]:
0     86400.0
1    172800.0
2    259200.0
dtype: float64

In [8]: ser.astype("timedelta64[D]")
Out[8]:
0    1.0
1    2.0
2    3.0
dtype: float64

新的行為與 datetime64 類似,要麼提供精確請求的資料型別,要麼引發異常。

新行為:

In [34]: ser.astype("timedelta64[s]")
Out[34]: 
0   1 days
1   2 days
2   3 days
dtype: timedelta64[s]

In [35]: ser.astype("timedelta64[D]")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[35], line 1
----> 1 ser.astype("timedelta64[D]")

File ~/work/pandas/pandas/pandas/core/generic.py:6541, in NDFrame.astype(self, dtype, copy, errors)
   6537     results = [ser.astype(dtype, errors=errors) for _, ser in self.items()]
   6539 else:
   6540     # else, only a single dtype is given
-> 6541     new_data = self._mgr.astype(dtype=dtype, errors=errors)
   6542     res = self._constructor_from_mgr(new_data, axes=new_data.axes)
   6543     return res.__finalize__(self, method="astype")

File ~/work/pandas/pandas/pandas/core/internals/managers.py:611, in BaseBlockManager.astype(self, dtype, errors)
    610 def astype(self, dtype, errors: str = "raise") -> Self:
--> 611     return self.apply("astype", dtype=dtype, errors=errors)

File ~/work/pandas/pandas/pandas/core/internals/managers.py:442, in BaseBlockManager.apply(self, f, align_keys, **kwargs)
    440         applied = b.apply(f, **kwargs)
    441     else:
--> 442         applied = getattr(b, f)(**kwargs)
    443     result_blocks = extend_blocks(applied, result_blocks)
    445 out = type(self).from_blocks(result_blocks, [ax.view() for ax in self.axes])

File ~/work/pandas/pandas/pandas/core/internals/blocks.py:607, in Block.astype(self, dtype, errors, squeeze)
    604         raise ValueError("Can not squeeze with more than one column.")
    605     values = values[0, :]  # type: ignore[call-overload]
--> 607 new_values = astype_array_safe(values, dtype, errors=errors)
    609 new_values = maybe_coerce_values(new_values)
    611 refs = None

File ~/work/pandas/pandas/pandas/core/dtypes/astype.py:240, in astype_array_safe(values, dtype, copy, errors)
    237     dtype = dtype.numpy_dtype
    239 try:
--> 240     new_values = astype_array(values, dtype, copy=copy)
    241 except (ValueError, TypeError):
    242     # e.g. _astype_nansafe can fail on object-dtype of strings
    243     #  trying to convert to float
    244     if errors == "ignore":

File ~/work/pandas/pandas/pandas/core/dtypes/astype.py:182, in astype_array(values, dtype, copy)
    178     return values
    180 if not isinstance(values, np.ndarray):
    181     # i.e. ExtensionArray
--> 182     values = values.astype(dtype, copy=copy)
    184 else:
    185     values = _astype_nansafe(values, dtype, copy=copy)

File ~/work/pandas/pandas/pandas/core/arrays/timedeltas.py:376, in TimedeltaArray.astype(self, dtype, copy)
    372         return type(self)._simple_new(
    373             res_values, dtype=res_values.dtype, freq=self.freq
    374         )
    375     else:
--> 376         raise ValueError(
    377             f"Cannot convert from {self.dtype} to {dtype}. "
    378             "Supported resolutions are 's', 'ms', 'us', 'ns'"
    379         )
    381 return dtl.DatetimeLikeArrayMixin.astype(self, dtype, copy=copy)

ValueError: Cannot convert from timedelta64[us] to timedelta64[D]. Supported resolutions are 's', 'ms', 'us', 'ns'

UTC 和固定偏移時區預設使用標準庫 tzinfo 物件#

在以前的版本中,用於表示 UTC 的預設 `tzinfo` 物件是 `pytz.UTC`。在 pandas 2.0 中,我們改為預設使用 `datetime.timezone.utc`。同樣,對於表示固定 UTC 偏移的時區,我們使用 `datetime.timezone` 物件而不是 `pytz.FixedOffset` 物件。請參閱 (GH 34916)。

先前行為:

In [2]: ts = pd.Timestamp("2016-01-01", tz="UTC")
In [3]: type(ts.tzinfo)
Out[3]: pytz.UTC

In [4]: ts2 = pd.Timestamp("2016-01-01 04:05:06-07:00")
In [3]: type(ts2.tzinfo)
Out[5]: pytz._FixedOffset

新行為:

In [36]: ts = pd.Timestamp("2016-01-01", tz="UTC")

In [37]: type(ts.tzinfo)
Out[37]: datetime.timezone

In [38]: ts2 = pd.Timestamp("2016-01-01 04:05:06-07:00")

In [39]: type(ts2.tzinfo)
Out[39]: datetime.timezone

對於既不是 UTC 也不是固定偏移的時區,例如“US/Pacific”,我們繼續預設使用 `pytz` 物件。

空的 DataFrame/Series 現在將預設具有 `RangeIndex`#

以前,在構造一個空的(其中 `data` 為 `None` 或空的類列表引數)`Series` 或 `DataFrame` 而未指定軸(`index=None`,`columns=None`)時,會返回具有 object 資料型別的空 `Index` 作為軸。

現在,軸返回一個空的 `RangeIndex` (GH 49572)。

先前行為:

In [8]: pd.Series().index
Out[8]:
Index([], dtype='object')

In [9] pd.DataFrame().axes
Out[9]:
[Index([], dtype='object'), Index([], dtype='object')]

新行為:

In [40]: pd.Series().index
Out[40]: RangeIndex(start=0, stop=0, step=1)

In [41]: pd.DataFrame().axes
Out[41]: [RangeIndex(start=0, stop=0, step=1), RangeIndex(start=0, stop=0, step=1)]

DataFrame 轉 LaTeX 具有新的渲染引擎#

現有的 `DataFrame.to_latex()` 已經過重構,使用了以前在 `Styler.to_latex()` 下可用的擴充套件實現。引數簽名類似,但 `col_space` 已被移除,因為它會被 LaTeX 引擎忽略。此渲染引擎還需要 `jinja2` 作為依賴項,由於渲染基於 jinja2 模板,因此需要安裝它。

下面的 pandas latex 選項不再使用,已被移除。通用的 max rows 和 columns 引數仍然保留,但對於此功能應替換為 Styler 的等效項。提供類似功能的替代選項如下所示。

  • `display.latex.escape`:替換為 `styler.format.escape`。

  • `display.latex.longtable`:替換為 `styler.latex.environment`。

  • `display.latex.multicolumn`、`display.latex.multicolumn_format` 和 `display.latex.multirow`:替換為 `styler.sparse.rows`、`styler.sparse.columns`、`styler.latex.multirow_align` 和 `styler.latex.multicol_align`。

  • `display.latex.repr`:替換為 `styler.render.repr`。

  • `display.max_rows` 和 `display.max_columns`:替換為 `styler.render.max_rows`、`styler.render.max_columns` 和 `styler.render.max_elements`。

請注意,由於此更改,一些預設值也發生了變化。

  • `multirow` 現在預設為 *True*。

  • `multirow_align` 預設為 *“r”* 而不是 *“l”*。

  • `multicol_align` 預設為 *“r”* 而不是 *“l”*。

  • `escape` 現在預設為 *False*。

請注意,`_repr_latex_` 的行為也發生了變化。以前,設定 `display.latex.repr` 會在僅使用 nbconvert 進行 JupyterNotebook 時生成 LaTeX,而在使用者執行 notebook 時不會。現在,`styler.render.repr` 選項允許在 JupyterNotebooks 中控制特定輸出的操作(不僅僅是針對 nbconvert)。請參閱 GH 39911

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

更新了一些依賴項的最低支援版本。如果已安裝,我們現在要求:

最低版本

必需

已更改

mypy (dev)

1.0

X

pytest (dev)

7.0.0

X

pytest-xdist (dev)

2.2.0

X

hypothesis (dev)

6.34.2

X

python-dateutil

2.8.2

X

X

tzdata

2022.1

X

X

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

最低版本

已更改

pyarrow

7.0.0

X

matplotlib

3.6.1

X

fastparquet

0.6.3

X

xarray

0.21.0

X

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

日期時間現在使用一致的格式進行解析#

過去,`to_datetime()` 會獨立猜測每個元素的時間格式。這對於某些元素具有混合日期格式的情況是合適的 - 但是,當用戶期望一致的格式而函式會在元素之間切換格式時,這經常會引起問題。從 2.0.0 版本開始,解析將使用一致的格式,該格式由第一個非 NA 值確定(除非使用者指定了格式,在這種情況下將使用該格式)。

舊行為:

In [1]: ser = pd.Series(['13-01-2000', '12-01-2000'])
In [2]: pd.to_datetime(ser)
Out[2]:
0   2000-01-13
1   2000-12-01
dtype: datetime64[ns]

新行為:

In [42]: ser = pd.Series(['13-01-2000', '12-01-2000'])

In [43]: pd.to_datetime(ser)
Out[43]: 
0   2000-01-13
1   2000-01-12
dtype: datetime64[us]

請注意,這也會影響 `read_csv()`。

如果你仍然需要解析不一致格式的日期,可以使用 `format='mixed'`(可能與 `dayfirst` 一起使用)。

ser = pd.Series(['13-01-2000', '12 January 2000'])
pd.to_datetime(ser, format='mixed', dayfirst=True)

或者,如果你的格式都是 ISO8601(但可能格式不完全相同)。

ser = pd.Series(['2020-01-01', '2020-01-01 03:00'])
pd.to_datetime(ser, format='ISO8601')

其他 API 更改#

  • `Timestamp` 建構函式中的 `tz`、`nanosecond` 和 `unit` 關鍵字現在是僅關鍵字引數 (GH 45307, GH 32526)。

  • 在 `Timestamp` 中傳遞大於 999 或小於 0 的 `nanoseconds` 現在會引發 `ValueError` (GH 48538, GH 48255)。

  • `read_csv()`: 當使用 c 解析器時,使用 `index_col` 指定錯誤的列數現在會引發 `ParserError` 而不是 `IndexError`。

  • `get_dummies()` 中 `dtype` 的預設值已從 `uint8` 更改為 `bool` (GH 45848)。

  • `DataFrame.astype()`、`Series.astype()` 和 `DatetimeIndex.astype()` 將 datetime64 資料型別轉換為“datetime64[s]”、“datetime64[ms]”、“datetime64[us]”中的任何一種,將返回具有給定解析度的物件,而不是強制轉換為“datetime64[ns]” (GH 48928)。

  • `DataFrame.astype()`、`Series.astype()` 和 `DatetimeIndex.astype()` 將 timedelta64 資料型別轉換為“timedelta64[s]”、“timedelta64[ms]”、“timedelta64[us]”中的任何一種,將返回具有給定解析度的物件,而不是強制轉換為“float64”資料型別 (GH 48963)。

  • `DatetimeIndex.astype()`、`TimedeltaIndex.astype()`、`PeriodIndex.astype()`、`Series.astype()`、`DataFrame.astype()` 使用 `datetime64`、`timedelta64` 或 `PeriodDtype` 資料型別,現在不允許轉換為“int64”以外的整數資料型別,而是執行 `obj.astype('int64', copy=False).astype(dtype)` (GH 49715)。

  • `Index.astype()` 現在允許從 `float64` 資料型別轉換為類 datetime 的資料型別,與 `Series` 的行為匹配 (GH 49660)。

  • 將具有“timedelta64[s]”、“timedelta64[ms]”或“timedelta64[us]”資料型別的資料傳遞給 `TimedeltaIndex`、`Series` 或 `DataFrame` 建構函式,現在將保留該資料型別而不是強制轉換為“timedelta64[ns]”;具有較低解析度的 timedelta64 資料將被強制轉換為最低支援的解析度“timedelta64[s]” (GH 49014)。

  • 將“timedelta64[s]”、“timedelta64[ms]”或“timedelta64[us]”的資料型別傳遞給 `TimedeltaIndex`、`Series` 或 `DataFrame` 建構函式,現在將保留該資料型別而不是強制轉換為“timedelta64[ns]”;對於 `Series` 或 `DataFrame`,傳遞具有較低解析度的資料型別將被強制轉換為最低支援的解析度“timedelta64[s]” (GH 49014)。

  • 將具有非納秒解析度的 `np.datetime64` 物件傳遞給 `Timestamp` 將保留輸入解析度(如果它是“s”、“ms”、“us”或“ns”);否則,它將被強制轉換為最接近的支援解析度 (GH 49008)。

  • 將具有非納秒解析度的 `datetime64` 值傳遞給 `to_datetime()` 將保留輸入解析度(如果它是“s”、“ms”、“us”或“ns”);否則,它將被強制轉換為最接近的支援解析度 (GH 50369)。

  • 將整數值和非納秒 datetime64 資料型別(例如“datetime64[s]”)傳遞給 `DataFrame`、`Series` 或 `Index` 建構函式,將把這些值視為資料型別單位的倍數,與 `Series(np.array(values, dtype="M8[s]"))` 的行為相匹配 (GH 51092)。

  • 將 ISO-8601 格式的字串傳遞給 `Timestamp` 將保留解析輸入的が解析度(如果它是“s”、“ms”、“us”或“ns”);否則,它將被強制轉換為最接近的支援解析度 (GH 49737)。

  • `DataFrame.mask()` 和 `Series.mask()` 中的 `other` 引數現在預設為 `no_default` 而不是 `np.nan`,這與 `DataFrame.where()` 和 `Series.where()` 一致。條目將用相應的 NULL 值填充(對於 numpy 資料型別為 `np.nan`,對於擴充套件資料型別為 `pd.NA`)。(GH 49111)。

  • 更改了 `Series.quantile()` 和 `DataFrame.quantile()` 使用 `SparseDtype` 時保留稀疏資料型別的行為 (GH 49583)。

  • 在建立具有類 datetime 物件的 object-dtype `Index` 的 `Series` 時,pandas 不再默默地將索引轉換為 `DatetimeIndex` (GH 39307, GH 23598)。

  • `pandas.testing.assert_index_equal()` 使用 `exact="equiv"` 引數時,現在認為兩個索引相等,當它們都是 `RangeIndex` 或具有 `int64` 資料型別的 `Index` 時。以前,這意味著它們是 `RangeIndex` 或 `Int64Index` (GH 51098)。

  • Series.unique() 對 dtype 為“timedelta64[ns]”或“datetime64[ns]”時,現在返回 TimedeltaArrayDatetimeArray,而不是 numpy.ndarrayGH 49176

  • to_datetime()DatetimeIndex 現在允許包含 datetime 物件和數字條目的序列,與 Series 的行為保持一致(GH 49037GH 50453

  • pandas.api.types.is_string_dtype() 現在僅對 dtype 為“object”且元素被推斷為字串的類陣列(array-likes)返回 TrueGH 15585

  • 將包含 datetime 物件和 date 物件的序列傳遞給 Series 建構函式時,將返回 dtype 為“object”而不是“datetime64[ns]”,這與 Index 的行為一致(GH 49341

  • 將無法解析為 datetimes 的字串傳遞給 SeriesDataFrame 並設定 dtype="datetime64[ns]" 時,將引發錯誤,而不是靜默忽略該關鍵字並返回 dtype 為“object”(GH 24435

  • 將包含無法轉換為 Timedelta 的型別的序列傳遞給 to_timedelta(),或傳遞給 SeriesDataFrame 建構函式(設定 dtype="timedelta64[ns]"),或者傳遞給 TimedeltaIndex 時,現在將引發 TypeError,而不是 ValueErrorGH 49525

  • 改變了 Index 建構函式在處理包含至少一個 NaT 且其他所有元素都為 NoneNaN 的序列時的行為,現在推斷為 datetime64[ns] dtype,而不是 object,這與 Series 的行為一致(GH 49340

  • 使用 index_col 引數設定為 None(預設值)的 read_stata(),現在將返回的 DataFrame 的索引設定為 RangeIndex,而不是 Int64IndexGH 49745

  • 改變了 IndexSeriesDataFrame 在處理 object-dtype 時的算術方法行為,結果不再對陣列操作的結果進行型別推斷,使用 result.infer_objects(copy=False) 來對結果進行型別推斷(GH 49999GH 49714

  • 改變了 Index 建構函式在處理包含全部布林值或全部複數的 object-dtype numpy.ndarray 時的行為,現在將保留 object dtype,與 Series 的行為一致(GH 49594

  • 改變了 Series.astype() 從包含 bytes 物件的 object-dtype 轉換為字串 dtype 的行為,現在對 bytes 物件執行 val.decode() 而不是 str(val),與 Index.astype() 的行為一致(GH 45326

  • read_csv() 的預設 na_values 中添加了 "None"GH 50286

  • 改變了 SeriesDataFrame 建構函式在給定整數 dtype 和非整數浮點資料時的行為,現在將引發 ValueError,而不是靜默保留浮點 dtype;使用 Series(data)DataFrame(data) 以獲得舊行為,使用 Series(data).astype(dtype)DataFrame(data).astype(dtype) 以獲得指定的 dtype(GH 49599

  • 改變了 DataFrame.shift() 使用 axis=1、整數 fill_value 和同質日期時間(datetime-like)dtype 時的行為,現在使用整數 dtype 填充新列,而不是轉換為日期時間型別(GH 49842

  • read_json() 中遇到異常時,檔案現在會被關閉(GH 49921

  • 改變了 read_csv()read_json()read_fwf() 的行為,當未指定索引時,索引現在總是 RangeIndex。之前,如果新的 DataFrame/Series 長度為 0,索引將是 dtype 為 objectIndexGH 49572

  • DataFrame.values()DataFrame.to_numpy()DataFrame.xs()DataFrame.reindex()DataFrame.fillna()DataFrame.replace() 不再靜默地合併底層陣列;使用 df = df.copy() 來確保合併(GH 49356

  • 使用 lociloc(即 df.loc[:, :]df.iloc[:, :])在兩個軸上進行全切片建立一個新 DataFrame,現在返回的是新 DataFrame(淺複製),而不是原始 DataFrame,這與其他獲取全切片的方法(例如 df.loc[:]df[:])一致(GH 49469

  • SeriesDataFrame 建構函式分別接收 Series 和 DataFrame,並且 copy=False(預設值)且沒有其他關鍵字觸發複製時,將返回一個淺複製(即共享資料,但不共享屬性)。之前,新的 Series 或 DataFrame 會共享索引屬性(例如,df.index = ... 也會更新父或子物件的索引)(GH 49523

  • 不允許計算 Timedelta 物件的 cumprod;之前會返回錯誤的值(GH 50246

  • 從 HDFStore 檔案讀取的 DataFrame 物件(在沒有索引的情況下讀取)現在具有 RangeIndex 而不是 int64 索引(GH 51076

  • 使用包含 NA 和/或 NaT 的數字 numpy dtype 來例項化 Index 時,現在會引發 ValueError。之前會引發 TypeErrorGH 51050

  • 使用 read_json(orient='split') 載入包含重複列的 JSON 檔案時,會重新命名列以避免重複,就像 read_csv() 和其他讀取器一樣(GH 50370

  • Series.sparse.from_coo 返回的 Series 的索引的級別現在總是具有 int32 dtype。之前它們具有 int64 dtype(GH 50926

  • to_datetime()unit 為“Y”或“M”時,如果序列包含非整數浮點值,則會引發錯誤,這與 Timestamp 的行為一致(GH 50301

  • 方法 Series.round()DataFrame.__invert__()Series.__invert__()DataFrame.swapaxes()DataFrame.first()DataFrame.last()Series.first()Series.last()DataFrame.align() 現在總是返回新物件(GH 51032

  • DataFrameDataFrameGroupBy 的聚合(例如“sum”)處理 object-dtype 列時,結果不再推斷非 object dtypes,顯式呼叫結果上的 result.infer_objects(copy=False) 來獲得舊行為(GH 51205GH 49603

  • 使用 ArrowDtype dtype 進行零除法操作時,將返回 -infnaninf(取決於分子),而不是引發錯誤(GH 51541

  • 添加了 pandas.api.types.is_any_real_numeric_dtype() 來檢查實數數值 dtype(GH 51152

  • value_counts() 現在返回具有 ArrowDtype(具有 pyarrow.int64 型別)的資料,而不是 "Int64" 型別(GH 51462

  • factorize()unique() 在傳入具有非納秒解析度的 numpy timedelta64 或 datetime64 時,會保留原始 dtype(GH 48670

注意

一項當前的 PDEP 提案建議棄用並移除 pandas API 中除一小部分方法外的所有方法的 inplacecopy 關鍵字。當前的討論在此進行:這裡。在 Copy-on-Write 的背景下,這些關鍵字將不再是必需的。如果該提案被接受,這兩個關鍵字將在 pandas 的下一個版本中被棄用,並在 pandas 3.0 中被移除。

棄用#

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

  • 已移除 Int64IndexUInt64IndexFloat64Index。更多資訊請參閱 此處 (GH 42717)

  • 已移除 Timestamp.freqTimestamp.freqstr 的棄用以及 Timestamp 建構函式和 Timestamp.fromordinal() 中的 freq 引數 (GH 14146)

  • 已移除已棄用的 CategoricalBlockBlock.is_categorical(),要求在將 datetime64 和 timedelta64 值傳遞給 Block.make_block_same_class() 之前將其包裝在 DatetimeArrayTimedeltaArray 中,要求將 DatetimeTZBlock.values 在傳遞給 BlockManager 建構函式時具有正確的 ndim,並移除了 SingleBlockManager 建構函式中的“fastpath”關鍵字 (GH 40226, GH 40571)

  • 已棄用全域性選項 use_inf_as_null,請改用 use_inf_as_na (GH 17126)

  • 已移除已棄用的模組 pandas.core.index (GH 30193)

  • 已移除已棄用的別名 pandas.core.tools.datetimes.to_time,請直接從 pandas.core.tools.times 匯入該函式 (GH 34145)

  • 已移除已棄用的別名 pandas.io.json.json_normalize,請直接從 pandas.json_normalize 匯入該函式 (GH 27615)

  • 已棄用 Categorical.to_dense(),請改用 np.asarray(cat) (GH 32639)

  • 已棄用 Categorical.take_nd() (GH 27745)

  • 已棄用 Categorical.mode(),請改用 Series(cat).mode() (GH 45033)

  • 已棄用 Categorical.is_dtype_equal()CategoricalIndex.is_dtype_equal() (GH 37545)

  • 已棄用 CategoricalIndex.take_nd() (GH 30702)

  • 已棄用 Index.is_type_compatible() (GH 42113)

  • 已棄用 Index.is_mixed(),請直接檢查 index.inferred_type (GH 32922)

  • 已棄用 pandas.api.types.is_categorical();請改用 pandas.api.types.is_categorical_dtype() (GH 33385)

  • 已棄用 Index.asi8() (GH 37877)

  • 強制執行棄用,更改了將 datetime64[ns] dtype 資料和帶時區的 dtype 傳遞給 Series 時的行為,將其解釋為實際時間而不是 UTC 時間,與 DatetimeIndex 的行為一致 (GH 41662)

  • 強制執行棄用,更改了在對多個非對齊(在索引或列上)的 DataFrame 應用 numpy ufunc 時的行為,現在將首先對輸入進行對齊 (GH 39239)

  • 已移除已棄用的 DataFrame._AXIS_NUMBERS()DataFrame._AXIS_NAMES()Series._AXIS_NUMBERS()Series._AXIS_NAMES() (GH 33637)

  • 已棄用 Index.to_native_types(),請改用 obj.astype(str) (GH 36418)

  • 已棄用 Series.iteritems()DataFrame.iteritems(),請改用 obj.items (GH 45321)

  • 已棄用 DataFrame.lookup() (GH 35224)

  • 已棄用 Series.append()DataFrame.append(),請改用 concat() (GH 35407)

  • 已棄用 Series.iteritems()DataFrame.iteritems()HDFStore.iteritems(),請改用 obj.items (GH 45321)

  • 已棄用 DatetimeIndex.union_many() (GH 45018)

  • 已棄用 DatetimeArrayDatetimeIndexdt 訪問器中的 weekofyearweek 屬性,請改用 isocalendar().week (GH 33595)

  • 已棄用 RangeIndex._start()RangeIndex._stop()RangeIndex._step(),請改用 startstopstep (GH 30482)

  • 已棄用 DatetimeIndex.to_perioddelta(),請使用 dtindex - dtindex.to_period(freq).to_timestamp() (GH 34853)

  • 已棄用 Styler.hide_index()Styler.hide_columns() (GH 49397)

  • 已棄用 Styler.set_na_rep()Styler.set_precision() (GH 49397)

  • 已棄用 Styler.where() (GH 49397)

  • 已棄用 Styler.render() (GH 49397)

  • 已移除 DataFrame.to_latex() 中的已棄用引數 col_space (GH 47970)

  • 已移除 Styler.highlight_null() 中的已棄用引數 null_color (GH 49397)

  • 已移除 testing.assert_frame_equal()testing.assert_extension_array_equal()testing.assert_series_equal()testing.assert_index_equal() 中的已棄用引數 check_less_precise (GH 30562)

  • 已移除 DataFrame.info() 中的已棄用引數 null_counts。請改用 show_counts (GH 37999)

  • 已棄用 Index.is_monotonic()Series.is_monotonic();請改用 obj.is_monotonic_increasing (GH 45422)

  • 已棄用 Index.is_all_dates() (GH 36697)

  • 強制執行棄用,禁止將帶時區的 Timestampdtype="datetime64[ns]" 傳遞給 SeriesDataFrame 建構函式 (GH 41555)

  • 強制執行棄用,禁止將帶時區的日期時間序列和 dtype="datetime64[ns]" 傳遞給 SeriesDataFrame 建構函式 (GH 41555)

  • 強制執行棄用,禁止在 DataFrame 建構函式中使用 numpy.ma.mrecords.MaskedRecords;請改用 "{name: data[name] for name in data.dtype.names} (GH 40363)

  • 強制執行棄用,禁止在 Series.astype()DataFrame.astype() 中使用無單位的“datetime64” dtype (GH 47844)

  • 強制執行棄用,禁止使用 .astypedatetime64[ns] 型別的 SeriesDataFrameDatetimeIndex 轉換為帶時區的 dtype,請改用 obj.tz_localizeser.dt.tz_localize (GH 39258)

  • 強制執行棄用,禁止使用 .astype 將帶時區的 SeriesDataFrameDatetimeIndex 轉換為不帶時區的 datetime64[ns] dtype,請改用 obj.tz_localize(None)obj.tz_convert("UTC").tz_localize(None) (GH 39258)

  • 強制執行棄用,禁止在 concat() 中將非布林引數傳遞給 sort (GH 44629)

  • 已移除日期解析函式 parse_date_time()parse_date_fields()parse_all_fields()generic_parser() (GH 24518)

  • 已移除 core.arrays.SparseArray 建構函式中的 index 引數 (GH 43523)

  • 已移除 DataFrame.groupby()Series.groupby() 中的 squeeze 引數 (GH 32380)

  • 已移除 DateOffset 中的已棄用屬性 applyapply_index__call__onOffsetisAnchored (GH 34171)

  • 已移除 DatetimeIndex.to_series() 中的 keep_tz 引數 (GH 29731)

  • 已移除 Index.copy() 中的 namesdtype 引數,以及 MultiIndex.copy() 中的 levelscodes 引數 (GH 35853, GH 36685)

  • 已移除 MultiIndex.set_levels()MultiIndex.set_codes() 中的 inplace 引數 (GH 35626)

  • 已移除 DataFrame.to_excel()Series.to_excel() 中的引數 verboseencoding (GH 47912)

  • 已移除 DataFrame.to_csv()Series.to_csv() 中的引數 line_terminator,請改用 lineterminator (GH 45302)

  • 已移除 DataFrame.set_axis()Series.set_axis() 中的 inplace 引數,請改用 obj = obj.set_axis(..., copy=False) (GH 48130)

  • 禁止向 MultiIndex.set_levels()MultiIndex.set_codes() 傳遞位置引數 (GH 41485)

  • 禁止解析包含“Y”、“y”或“M”單位的日期間隔字串,因為這些不代表無歧義的持續時間 (GH 36838)

  • 已移除 MultiIndex.is_lexsorted()MultiIndex.lexsort_depth() (GH 38701)

  • 已移除 PeriodIndex.astype() 中的 how 引數,請改用 PeriodIndex.to_timestamp() (GH 37982)

  • 已移除 DataFrame.mask()DataFrame.where()Series.mask()Series.where() 中的 try_cast 引數 (GH 38836)

  • 已移除 Period.to_timestamp() 中的 tz 引數,請改用 obj.to_timestamp(...).tz_localize(tz) (GH 34522)

  • 已移除 DataFrame.plot()Series.plot() 中的 sort_columns 引數 (GH 47563)

  • DataFrame.take()Series.take() 中移除了引數 is_copy (GH 30615)

  • Index.get_slice_bound(), Index.slice_indexer()Index.slice_locs() 中移除了引數 kind (GH 41378)

  • read_csv() 中移除了引數 prefix, squeeze, error_bad_lineswarn_bad_lines (GH 40413, GH 43427)

  • read_excel() 中移除了引數 squeeze (GH 43427)

  • DataFrame.describe()Series.describe() 中移除了引數 datetime_is_numeric,因為日期時間資料將始終按數值資料進行彙總 (GH 34798)

  • 不允許將列表 key 傳遞給 Series.xs()DataFrame.xs(),請改為傳遞元組 (GH 41789)

  • Index 建構函式中不允許傳遞子類特定的關鍵字(例如 “freq”, “tz”, “names”, “closed”)(GH 38597)

  • Categorical.remove_unused_categories() 中移除了引數 inplace (GH 37918)

  • 不允許使用 unit="M"unit="Y" 將非整數浮點數傳遞給 Timestamp (GH 47266)

  • read_excel() 中移除了關鍵字 convert_floatmangle_dupe_cols (GH 41176)

  • read_csv()read_table() 中移除了關鍵字 mangle_dupe_cols (GH 48137)

  • DataFrame.where(), Series.where(), DataFrame.mask()Series.mask() 中移除了 errors 關鍵字 (GH 47728)

  • 不允許將非關鍵字引數傳遞給 read_excel(),除了 iosheet_name (GH 34418)

  • 不允許將非關鍵字引數傳遞給 DataFrame.drop()Series.drop(),除了 labels (GH 41486)

  • 不允許將非關鍵字引數傳遞給 DataFrame.fillna()Series.fillna(),除了 value (GH 41485)

  • 不允許將非關鍵字引數傳遞給 StringMethods.split()StringMethods.rsplit(),除了 pat (GH 47448)

  • 不允許將非關鍵字引數傳遞給 DataFrame.set_index(),除了 keys (GH 41495)

  • 不允許將非關鍵字引數傳遞給 Resampler.interpolate(),除了 method (GH 41699)

  • 不允許將非關鍵字引數傳遞給 DataFrame.reset_index()Series.reset_index(),除了 level (GH 41496)

  • 不允許將非關鍵字引數傳遞給 DataFrame.dropna()Series.dropna() (GH 41504)

  • 不允許將非關鍵字引數傳遞給 ExtensionArray.argsort() (GH 46134)

  • 不允許將非關鍵字引數傳遞給 Categorical.sort_values() (GH 47618)

  • 不允許將非關鍵字引數傳遞給 Index.drop_duplicates()Series.drop_duplicates() (GH 41485)

  • 不允許將非關鍵字引數傳遞給 DataFrame.drop_duplicates(),除了 subset (GH 41485)

  • 不允許將非關鍵字引數傳遞給 DataFrame.sort_index()Series.sort_index() (GH 41506)

  • 不允許將非關鍵字引數傳遞給 DataFrame.interpolate()Series.interpolate(),除了 method (GH 41510)

  • 不允許將非關鍵字引數傳遞給 DataFrame.any()Series.any() (GH 44896)

  • 不允許將非關鍵字引數傳遞給 Index.set_names(),除了 names (GH 41551)

  • 不允許將非關鍵字引數傳遞給 Index.join(),除了 other (GH 46518)

  • 不允許將非關鍵字引數傳遞給 concat(),除了 objs (GH 41485)

  • 不允許將非關鍵字引數傳遞給 pivot(),除了 data (GH 48301)

  • 不允許將非關鍵字引數傳遞給 DataFrame.pivot() (GH 48301)

  • 不允許將非關鍵字引數傳遞給 read_html(),除了 io (GH 27573)

  • 不允許將非關鍵字引數傳遞給 read_json(),除了 path_or_buf (GH 27573)

  • 不允許將非關鍵字引數傳遞給 read_sas(),除了 filepath_or_buffer (GH 47154)

  • 不允許將非關鍵字引數傳遞給 read_stata(),除了 filepath_or_buffer (GH 48128)

  • 不允許將非關鍵字引數傳遞給 read_csv(),除了 filepath_or_buffer (GH 41485)

  • 不允許將非關鍵字引數傳遞給 read_table(),除了 filepath_or_buffer (GH 41485)

  • 不允許將非關鍵字引數傳遞給 read_fwf(),除了 filepath_or_buffer (GH 44710)

  • 不允許將非關鍵字引數傳遞給 read_xml(),除了 path_or_buffer (GH 45133)

  • 不允許將非關鍵字引數傳遞給 Series.mask()DataFrame.mask(),除了 condother (GH 41580)

  • 不允許將非關鍵字引數傳遞給 DataFrame.to_stata(),除了 path (GH 48128)

  • 不允許將非關鍵字引數傳遞給 DataFrame.where()Series.where(),除了 condother (GH 41523)

  • 不允許將非關鍵字引數傳遞給 Series.set_axis()DataFrame.set_axis(),除了 labels (GH 41491)

  • 不允許將非關鍵字引數傳遞給 Series.rename_axis()DataFrame.rename_axis(),除了 mapper (GH 47587)

  • 不允許將非關鍵字引數傳遞給 Series.clip()DataFrame.clip(),除了 lowerupper (GH 41511)

  • 不允許將非關鍵字引數傳遞給 Series.bfill(), Series.ffill(), DataFrame.bfill()DataFrame.ffill() (GH 41508)

  • 不允許將非關鍵字引數傳遞給 DataFrame.replace(), Series.replace(),除了 to_replacevalue (GH 47587)

  • 不允許將非關鍵字引數傳遞給 DataFrame.sort_values(),除了 by (GH 41505)

  • 不允許將非關鍵字引數傳遞給 Series.sort_values() (GH 41505)

  • 不允許將非關鍵字引數傳遞給 DataFrame.reindex(),除了 labels (GH 17966)

  • 不允許使用非唯一的 Index 物件進行 Index.reindex() (GH 42568)

  • 不允許使用標量 data 來構造 Categorical (GH 38433)

  • 不允許在不傳遞 data 的情況下構造 CategoricalIndex (GH 38944)

  • 移除了 Rolling.validate(), Expanding.validate(), 和 ExponentialMovingWindow.validate() (GH 43665)

  • 移除了 Rolling.win_type 返回 "freq" (GH 38963)

  • 移除了 Rolling.is_datetimelike (GH 38963)

  • 移除了 DataFrameSeries 聚合中的 level 關鍵字;改為使用 groupby (GH 39983)

  • 移除了已棄用的 Timedelta.delta(), Timedelta.is_populated(), 和 Timedelta.freq (GH 46430, GH 46476)

  • 移除了已棄用的 NaT.freq (GH 45071)

  • 移除了已棄用的 Categorical.replace(),請改用 Series.replace() (GH 44929)

  • Categorical.min()Categorical.max() 中移除了 numeric_only 關鍵字,改用 skipna (GH 48821)

  • 改變了 DataFrame.median()DataFrame.mean()numeric_only=None 時不排除日期時間列的行為。在強制執行 numeric_only=None 棄用後,此註釋將不再相關 (GH 29941)

  • 移除了 is_extension_type(),改用 is_extension_array_dtype() (GH 29457)

  • 移除了 .ExponentialMovingWindow.vol (GH 39220)

  • 移除了 Index.get_value()Index.set_value() (GH 33907, GH 28621)

  • 移除了 Series.slice_shift()DataFrame.slice_shift() (GH 37601)

  • 移除了 DataFrameGroupBy.pad()DataFrameGroupBy.backfill() (GH 45076)

  • 移除了 read_json() 中的 numpy 引數 (GH 30636)

  • DataFrame.to_dict() 中不允許傳入 orient 的縮寫 (GH 32516)

  • 不允許在非單調遞增的 DatetimeIndex 上使用不在 Index 中的鍵進行部分切片。現在會引發 KeyError (GH 18531)

  • 移除了 get_offset,改為使用 to_offset() (GH 30340)

  • 移除了 infer_freq() 中的 warn 關鍵字引數 (GH 45947)

  • 移除了 DataFrame.between_time() 中的 include_startinclude_end 引數,改為使用 inclusive (GH 43248)

  • 移除了 date_range()bdate_range() 中的 closed 引數,改為使用 inclusive 引數 (GH 40245)

  • 移除了 DataFrame.expanding() 中的 center 關鍵字引數 (GH 20647)

  • 移除了 eval() 中的 truediv 關鍵字引數 (GH 29812)

  • 移除了 Index.get_loc() 中的 methodtolerance 引數。請改用 index.get_indexer([label], method=..., tolerance=...) (GH 42269)

  • 移除了 pandas.datetime 子模組 (GH 30489)

  • 移除了 pandas.np 子模組 (GH 30296)

  • 移除了 pandas.util.testing,改為使用 pandas.testing (GH 30745)

  • 移除了 Series.str.__iter__() (GH 28277)

  • 移除了 pandas.SparseArray,改為使用 arrays.SparseArray (GH 30642)

  • 移除了 pandas.SparseSeriespandas.SparseDataFrame,包括 pickle 支援。(GH 30642)

  • 強制不允許在具有 datetime64、timedelta64 或 period 資料型別的 DataFrame.shift()Series.shift() 中傳入整數 fill_value (GH 32591)

  • 強制不允許在 DataFrame.ewm()times 引數中傳入字串列標籤 (GH 43265)

  • 強制不允許在 Series.between() 中為 inclusive 引數傳入 TrueFalse,分別改為使用 "both""neither" (GH 40628)

  • 強制不允許在 engine="c"read_csv 中使用超出邊界索引的 usecols (GH 25623)

  • 強制不允許在 ExcelWriter 中使用 **kwargs;請改用 engine_kwargs 關鍵字引數 (GH 40430)

  • 強制不允許在 DataFrameGroupBy.__getitem__() 中傳入元組形式的列標籤 (GH 30546)

  • 強制不允許在 MultiIndex 的某個層級上使用標籤序列進行索引時缺少標籤。現在會引發 KeyError (GH 42351)

  • 強制不允許使用位置切片透過 .loc 設定值。請改用帶標籤的 .loc 或帶位置的 .iloc (GH 31840)

  • 強制不允許使用浮點數 float 鍵進行位置索引,即使該鍵是整數。請手動轉換為整數後再使用 (GH 34193)

  • 強制不允許使用 DataFrame 索引器搭配 .iloc;請改用 .loc 以實現自動對齊 (GH 39022)

  • 強制不允許在 __getitem____setitem__ 方法中使用 setdict 索引器 (GH 42825)

  • 強制不允許對產生多維物件的 Index 進行索引或對 Series 進行位置索引,例如 obj[:, None]。請先轉換為 numpy 陣列再進行索引 (GH 35141)

  • 強制不允許在 merge()suffixes 引數中傳入 dictset 物件 (GH 34810)

  • 強制不允許 merge() 透過 suffixes 關鍵字引數和已存在的列產生重複的列 (GH 22818)

  • 強制不允許在不同層級數量的 merge()join() 上操作 (GH 34862)

  • 強制不允許在 DataFrame.melt() 中使用 value_name 引數來匹配 DataFrame 列中的某個元素 (GH 35003)

  • 強制不允許在 DataFrame.to_markdown()Series.to_markdown() 中透過 **kwargs 傳入 showindex,改為使用 index 引數 (GH 33091)

  • 移除了直接設定 Categorical._codes 的操作 (GH 41429)

  • 移除了直接設定 Categorical.categories 的操作 (GH 47834)

  • Categorical.add_categories(), Categorical.remove_categories(), Categorical.set_categories(), Categorical.rename_categories(), Categorical.reorder_categories(), Categorical.set_ordered(), Categorical.as_ordered(), Categorical.as_unordered() 中移除了 inplace 引數 (GH 37981, GH 41118, GH 41133, GH 47834)

  • 強制 Rolling.count()min_periods=None 時預設使用視窗大小 (GH 31302)

  • DataFrame.to_parquet(), DataFrame.to_stata()DataFrame.to_feather() 中將 fname 重新命名為 path (GH 30338)

  • 強制不允許使用切片(例如 ser[[slice(0, 2)]])對 Series 進行單元素列表索引。請將列表轉換為元組,或直接傳遞切片 (GH 31333)

  • 改變了使用字串索引器對具有 DatetimeIndex 索引的 DataFrame 進行索引的行為。之前該操作會應用於行的切片,現在其行為類似於其他列鍵;要實現舊行為,請使用 frame.loc[key] (GH 36179)

  • 強制 display.max_colwidth 選項不再接受負整數 (GH 31569)

  • 移除了 display.column_space 選項,改為使用 df.to_string(col_space=...) (GH 47280)

  • 移除了 pandas 類中已棄用的 mad 方法 (GH 11787)

  • 移除了 pandas 類中已棄用的 tshift 方法 (GH 11631)

  • 改變了將空資料傳入 Series 的行為;預設 dtype 將是 object 而不是 float64 (GH 29405)

  • 改變了 DatetimeIndex.union(), DatetimeIndex.intersection(), 和 DatetimeIndex.symmetric_difference() 在處理時區不匹配時,會轉換為 UTC 而不是強制轉換為 object dtype (GH 39328)

  • 改變了 to_datetime()utc=False 時使用引數 “now” 的行為,使其與 Timestamp("now") 保持一致 (GH 18705)

  • 改變了在時區感知 DatetimeIndex 上使用時區不感知 datetime 物件進行索引,或反之亦然的行為;現在這些情況會像其他任何不可比較型別一樣引發 KeyError (GH 36148)

  • 改變了 Index.reindex(), Series.reindex(), 和 DataFrame.reindex() 在具有 datetime64 dtype 和 datetime.date 物件作為 fill_value 時的行為;這些不再被視為等同於 datetime.datetime 物件,因此 reindex 會強制轉換為 object dtype (GH 39767)

  • 改變了 SparseArray.astype() 在給定一個不明確為 SparseDtype 的 dtype 時的行為,會強制轉換為精確請求的 dtype,而不是靜默地使用 SparseDtype (GH 34457)

  • 改變了 Index.ravel() 的行為,使其返回原始 Index 的檢視,而不是 np.ndarray (GH 36900)

  • 改變了 Series.to_frame()Index.to_frame() 在顯式指定 name=None 時的行為,現在會使用 None 作為列名,而不是索引的名稱或預設值 0 (GH 45523)

  • 改變了 concat() 在一個 bool 型別陣列和一個整數型別陣列的組合時的行為,現在返回 object dtype 而不是 integer dtype;要獲得舊行為,請在連線前顯式地將 bool 物件轉換為 integer (GH 45101)

  • 改變了 DataFrame 建構函式在傳入浮點數 data 和整數 dtype 時的行為,當資料無法無損轉換時,會保留浮點數 dtype,與 Series 的行為一致 (GH 41170)

  • 改變了 Index 建構函式在傳入包含數值項的 object-dtype np.ndarray 時的行為,現在會保留 object dtype 而不是推斷數值 dtype,與 Series 的行為一致 (GH 42870)

  • 改變了 Index.__and__(), Index.__or__(), 和 Index.__xor__() 的行為,使其表現為邏輯運算(與 Series 的行為一致),而不是集合運算的別名 (GH 37374)

  • 改變了 DataFrame 建構函式在傳入的列表的第一個元素是 Categorical 時的行為,現在將元素視為行並強制轉換為 object dtype,這與對待其他型別時的行為一致 (GH 38845)

  • 改變了 DataFrame 建構函式在傳入一個無法無損轉換為資料 dtype(非 int)時的行為,現在會引發錯誤,而不是靜默忽略 dtype (GH 41733)

  • 改變了 Series 建構函式的行為,它將不再從字串條目推斷 datetime64 或 timedelta64 dtype (GH 41731)

  • 改變了 Timestamp 建構函式在使用 np.datetime64 物件和 tz 引數時,將輸入解釋為本地時間(wall-time),而不是 UTC 時間 (GH 42288)

  • 改變了 Timestamp.utcfromtimestamp() 的行為,使其返回一個時區感知的物件,滿足 Timestamp.utcfromtimestamp(val).timestamp() == val (GH 45083)

  • 改變了 Index 建構函式在傳入 SparseArraySparseDtype 時的行為,現在會保留該 dtype 而不是強制轉換為 numpy.ndarray (GH 43930)

  • 改變了對具有 DatetimeTZDtype 的物件執行類似 setitem 的操作(__setitem__, fillna, where, mask, replace, insert, shift 的 fill_value)時的行為,當使用具有不匹配時區的時區感知的 DatetimeTZDtype 物件時,值會被轉換為物件的時區,而不是將兩者都轉換為 object-dtype (GH 44243)

  • 改變了 Index, Series, DataFrame 建構函式在處理浮點數 dtype 資料和 DatetimeTZDtype 時的行為,現在資料被解釋為 UTC 時間而不是本地時間,這與整數 dtype 資料被處理的方式一致 (GH 45573)

  • 改變了 SeriesDataFrame 建構函式在處理包含 NaN 的浮點數資料以及整數 dtype 時的行為,現在會引發 IntCastingNaNError (GH 40110)

  • 改變了 SeriesDataFrame 建構函式在處理整數 dtype 和值過大無法無損轉換為該 dtype 時的行為,現在會引發 ValueError (GH 41734)

  • 改變了 SeriesDataFrame 建構函式在處理整數 dtype 和具有 datetime64timedelta64 dtype 的值時的行為,現在會引發 TypeError,請改用 values.view("int64") (GH 41770)

  • 移除了 pandas.DataFrame.resample(), pandas.Series.resample()pandas.Grouper 中已棄用的 baseloffset 引數。請改用 offsetorigin (GH 31809)

  • 更改了 `Series.fillna()` 和 `DataFrame.fillna()` 方法在處理 `timedelta64[ns]` 資料型別且 `fill_value` 不相容時的行為;現在此情況會強制轉換為 `object` 資料型別而不是引發錯誤,這與處理其他資料型別時的行為一致(GH 45746

  • 將 `Series.str.replace()` 方法的 `regex` 引數預設值從 `True` 更改為 `False`。此外,當 `regex=True` 時,單個字元 `pat` 現在會被視為正則表示式而不是字串字面量。(GH 36695GH 24804

  • 更改了 `DataFrame.any()` 和 `DataFrame.all()` 方法在 `bool_only=True` 時的行為;包含所有布林值的 object 型別列將不再被包含,需要先手動強制轉換為 `bool` 資料型別(GH 46188

  • 更改了 `DataFrame.max()`、`DataFrame.min`、`DataFrame.mean`、`DataFrame.median`、`DataFrame.skew`、`DataFrame.kurt` 方法在 `axis=None` 時的行為,現在會返回一個標量,該標量是透過跨兩個軸應用聚合得到的(GH 45072

  • 更改了 `Timestamp` 與 `datetime.date` 物件進行比較的行為;現在這些比較被視為不等,並在不等比較時引發錯誤,與 `datetime.datetime` 的行為一致(GH 36131

  • 更改了 `NaT` 與 `datetime.date` 物件進行比較的行為;現在不等比較時會引發錯誤(GH 39196

  • 強制執行了 `Series.transform` 和 `DataFrame.transform` 方法在與列表或字典一起使用時,當引發 `TypeError` 時,不再靜默刪除列(GH 43740

  • 更改了 `DataFrame.apply()` 方法與類列表(list-like)一起使用時的行為,現在任何部分失敗都會引發錯誤(GH 43740

  • 更改了 `DataFrame.to_latex()` 方法的行為,現在它透過 `Styler.to_latex()` 使用 Styler 實現(GH 47970

  • 更改了 `Series.__setitem__()` 方法在整數鍵和 `Float64Index` 結合使用,且鍵不在索引中時的行為;以前我們將鍵視為位置(行為類似於 `series.iloc[key] = val`),現在我們將其視為標籤(行為類似於 `series.loc[key] = val`),這與 `Series.__getitem__()` 的行為一致(GH 33469

  • 移除了 `factorize()`、`Index.factorize()` 和 `ExtensionArray.factorize()` 方法中的 `na_sentinel` 引數(GH 47157

  • 更改了 `Series.diff()` 和 `DataFrame.diff()` 方法在處理 `ExtensionDtype` 資料型別且其陣列未實現 `diff` 時的行為;現在這些操作會引發 `TypeError` 而不是強制轉換為 numpy(GH 31025

  • 強制執行了在使用 `method="outer"` 的 `DataFrame` 上呼叫 numpy "ufunc" 時的棄用;現在這會引發 `NotImplementedError`(GH 36955

  • 強制執行了棄用,不允許在非數值資料型別的 `Series` 縮減操作(`rank`、`any`、`all` 等)中傳遞 `numeric_only=True`(GH 47500

  • 更改了 `DataFrameGroupBy.apply()` 和 `SeriesGroupBy.apply()` 方法的行為,以便即使檢測到轉換器,`group_keys` 也會被尊重(GH 34998

  • `DataFrame` 與 `Series` 之間的比較,當 `DataFrame` 的列與 `Series` 的索引不匹配時,會引發 `ValueError` 而不是自動對齊;在比較之前,請執行 `left, right = left.align(right, axis=1, copy=False)`(GH 36795

  • 強制執行了棄用,不再允許在會靜默刪除引發錯誤的列的 `DataFrame` 縮減操作中使用 `numeric_only=None`(預設值);`numeric_only` 現在預設為 `False`(GH 41480

  • 在所有具有該引數的 `DataFrame` 方法中,將 `numeric_only` 的預設值更改為 `False`(GH 46096GH 46906

  • 在 `Series.rank()` 中將 `numeric_only` 的預設值更改為 `False`(GH 47561

  • 強制執行了棄用,不再允許在 `groupby` 和 `resample` 操作中,當 `numeric_only=False` 時,靜默刪除無關緊要的列(GH 41475

  • 強制執行了棄用,不再允許在 `Rolling`、`Expanding` 和 `ExponentialMovingWindow` 操作中靜默刪除無關緊要的列;現在這將引發 `errors.DataError`(GH 42834

  • 更改了使用 `df.loc[:, foo] = bar` 或 `df.iloc[:, foo] = bar` 設定值的行為;現在這些操作總是先嚐試就地設定值,然後再回退到強制型別轉換(GH 45333

  • 更改了各種 `DataFrameGroupBy` 方法中 `numeric_only` 的預設值;所有方法現在都預設為 `numeric_only=False`(GH 46072

  • 在 `Resampler` 方法中將 `numeric_only` 的預設值更改為 `False`(GH 47177

  • 使用 `DataFrameGroupBy.transform()` 方法和一個返回 `DataFrame` 的可呼叫物件時,將對齊到輸入的索引(GH 47244

  • 當向 `DataFrame.groupby()` 提供長度為一的列列表時,透過迭代產生的 `DataFrameGroupBy` 物件返回的鍵現在將是長度為一的元組(GH 47761

  • 移除了已棄用的方法 `ExcelWriter.write_cells()`、`ExcelWriter.save()`、`ExcelWriter.cur_sheet()`、`ExcelWriter.handles()`、`ExcelWriter.path()`(GH 45795

  • 現在不能再設定 `ExcelWriter` 的 `book` 屬性;它仍然可以訪問和修改(GH 48943

  • 移除了 `Rolling`、`Expanding` 和 `ExponentialMovingWindow` 操作中未使用的 `*args` 和 `**kwargs` 引數(GH 47851

  • 移除了 `DataFrame.to_csv()` 方法中已棄用的 `line_terminator` 引數(GH 45302

  • 移除了 `lreshape()` 函式中已棄用的 `label` 引數(GH 30219

  • `DataFrame.eval()` 和 `DataFrame.query()` 方法中 `expr` 引數之後的引數現在是關鍵字引數(GH 47587

  • 移除了 `Index._get_attributes_dict()` 方法(GH 50648

  • 移除了 `Series.__array_wrap__()` 方法(GH 50648

  • 更改了 `DataFrame.value_counts()` 方法的行為,當列表類(一個元素或多個)輸入時,返回一個具有 `MultiIndex` 的 `Series`;當輸入是單個標籤時,返回一個 `Index`(GH 50829

效能改進#

  • 對 nullable 資料型別的 `DataFrameGroupBy.median()`、`SeriesGroupBy.median()` 和 `DataFrameGroupBy.cumprod()` 方法進行了效能改進(GH 37493

  • 對 object 資料型別的 `DataFrameGroupBy.all()`、`DataFrameGroupBy.any()`、`SeriesGroupBy.all()` 和 `SeriesGroupBy.any()` 方法進行了效能改進(GH 50623

  • 對 `MultiIndex.argsort()` 和 `MultiIndex.sort_values()` 方法進行了效能改進(GH 48406

  • 對 `MultiIndex.size()` 方法進行了效能改進(GH 48723

  • 對不含缺失值且不含重複值的 `MultiIndex.union()` 方法進行了效能改進(GH 48505GH 48752

  • 對 `MultiIndex.difference()` 方法進行了效能改進(GH 48606

  • 對 `sort=None` 的 `MultiIndex` 集合操作進行了效能改進(GH 49010

  • 對 extension array 資料型別的 `DataFrameGroupBy.mean()`、`SeriesGroupBy.mean()`、`DataFrameGroupBy.var()` 和 `SeriesGroupBy.var()` 方法進行了效能改進(GH 37493

  • 對 `level=None` 的 `MultiIndex.isin()` 方法進行了效能改進(GH 48622GH 49577

  • 對 `MultiIndex.putmask()` 方法進行了效能改進(GH 49830

  • 對包含重複值的 `Index.union()` 和 `MultiIndex.union()` 方法進行了效能改進(GH 48900

  • 對 pyarrow 支援的資料型別的 `Series.rank()` 方法進行了效能改進(GH 50264

  • 對 pyarrow 支援的資料型別的 `Series.searchsorted()` 方法進行了效能改進(GH 50447

  • 對 extension array 資料型別的 `Series.fillna()` 方法進行了效能改進(GH 49722GH 50078

  • 對 `Index.join()`、`Index.intersection()` 和 `Index.union()` 方法,當索引是單調的時,針對掩碼和 arrow 資料型別進行了效能改進(GH 50310GH 51365

  • 對 nullable 資料型別的 `Series.value_counts()` 方法進行了效能改進(GH 48338

  • 對傳入帶有 nullable 資料型別的整數 numpy 陣列的 `Series` 建構函式進行了效能改進(GH 48338

  • 對傳入列表的 `DatetimeIndex` 建構函式進行了效能改進(GH 48609

  • 在 `merge()` 和 `DataFrame.join()` 方法與已排序的 `MultiIndex` 進行連線時進行了效能改進(GH 48504

  • 在解析帶時區偏移的字串時,對 `to_datetime()` 函式進行了效能改進(GH 50107

  • 對使用元組基於 `MultiIndex` 進行索引的 `DataFrame.loc()` 和 `Series.loc()` 方法進行了效能改進(GH 48384

  • 對 categorical 資料型別的 `Series.replace()` 方法進行了效能改進(GH 49404

  • 對 `MultiIndex.unique()` 方法進行了效能改進(GH 48335

  • 對 nullable 和 arrow 資料型別的索引操作進行了效能改進(GH 49420GH 51316

  • 對使用 extension array 後備索引的 `concat()` 函式進行了效能改進(GH 49128GH 49178

  • 對 `api.types.infer_dtype()` 函式進行了效能改進(GH 51054

  • 當使用 BZ2 或 LZMA 時,降低了 `DataFrame.to_pickle()`/`Series.to_pickle()` 的記憶體使用量(GH 49068

  • 對傳入 `np.str_` 型別 numpy 陣列的 `StringArray` 建構函式進行了效能改進(GH 49109

  • 對 `from_tuples()` 方法進行了效能改進(GH 50620

  • 對 `factorize()` 方法進行了效能改進(GH 49177

  • 對 `__setitem__()` 方法進行了效能改進(GH 50248GH 50632

  • 當陣列包含 NA 值時,對 `ArrowExtensionArray` 的比較方法進行了效能改進(GH 50524

  • 對 `to_numpy()` 方法進行了效能改進(GH 49973GH 51227

  • 在將字串解析為 `BooleanDtype` 時進行了效能改進(GH 50613

  • 在 `DataFrame.join()` 方法與 `MultiIndex` 的子集進行連線時進行了效能改進(GH 48611

  • 對 `MultiIndex.intersection()` 方法進行了效能改進(GH 48604

  • 對 `DataFrame.__setitem__()` 方法進行了效能改進(GH 46267

  • 對 nullable 資料型別的 `var` 和 `std` 進行了效能改進(GH 48379)。

  • 在迭代 pyarrow 和 nullable 資料型別時進行了效能改進(GH 49825GH 49851

  • 對 `read_sas()` 函式進行了效能改進(GH 47403GH 47405GH 47656GH 48502

  • 對 `RangeIndex.sort_values()` 方法進行了記憶體改進(GH 48801

  • 當 `copy=True` 時,透過避免兩次複製,對 `Series.to_numpy()` 方法進行了效能改進(GH 24345

  • 使用 Series.rename()MultiIndex 時的效能改進 (GH 21055)

  • by 是分類型別且 sort=False 時,DataFrameGroupBySeriesGroupBy 的效能改進 (GH 48976)

  • by 是分類型別且 observed=False 時,DataFrameGroupBySeriesGroupBy 的效能改進 (GH 49596)

  • 使用引數 index_col 設定為 None(預設值)時,read_stata() 的效能改進。現在索引將是 RangeIndex 而不是 Int64Index (GH 49745)

  • 當不基於索引進行合併時,merge() 的效能改進 - 新的索引現在將是 RangeIndex 而不是 Int64Index (GH 49478)

  • 當使用任何非物件 dtype 時,DataFrame.to_dict()Series.to_dict() 的效能改進 (GH 46470)

  • 當存在多個表時,read_html() 的效能改進 (GH 49929)

  • 使用字串或整數構造 Period 建構函式時的效能改進 (GH 38312)

  • 當使用 '%Y%m%d' 格式時,to_datetime() 的效能改進 (GH 17410)

  • 當提供或可以推斷出格式時,to_datetime() 的效能改進 (GH 50465)

  • 對於可為空的 dtypes,Series.median() 的效能改進 (GH 50838)

  • 當將 to_datetime() lambda 函式傳遞給 date_parser 且輸入具有混合時區偏移量時,read_csv() 的效能改進 (GH 35296)

  • isna()isnull() 的效能改進 (GH 50658)

  • 對於分類 dtype,SeriesGroupBy.value_counts() 的效能改進 (GH 46202)

  • 修復了 read_hdf() 中的引用洩漏 (GH 37441)

  • 序列化日期時間和時間差時,DataFrame.to_json()Series.to_json() 中的記憶體洩漏已修復 (GH 40443)

  • 許多 DataFrameGroupBy 方法的記憶體使用量降低 (GH 51090)

  • 對於整數 decimal 引數,DataFrame.round() 的效能改進 (GH 17254)

  • 當使用大的 dict 作為 to_replace 時,DataFrame.replace()Series.replace() 的效能改進 (GH 6697)

  • 讀取可查詢檔案時 StataReader 的記憶體改進 (GH 48922)

Bug 修復#

分類#

日期時間型別#

時間差#

  • 當輸入具有可空 dtype Float64 時,to_timedelta() 引發錯誤的錯誤 (GH 48796)

  • 當給出 np.timedelta64("nat") 時,Timedelta 建構函式錯誤地引發錯誤而不是返回 NaT (GH 48898)

  • 當同時傳遞 Timedelta 物件和關鍵字引數(例如 days、seconds)時,Timedelta 建構函式未能引發錯誤的錯誤 (GH 48898)

  • 非常大的 datetime.timedelta 物件與 Timedelta 的比較錯誤地引發 OutOfBoundsTimedelta (GH 49021)

時區#

數值#

轉換#

字串#

Interval#

索引#

  • DataFrame.__setitem__()中,當索引器是具有boolean dtype的DataFrame時,會引發錯誤的錯誤(GH 47125

  • DataFrame.reindex()中,當索引列和uint dtypes的索引時,使用錯誤的填充值(GH 48184

  • DataFrame.loc()中,當使用具有不同dtype的DataFrame設定值時,會將值強制轉換為單個dtype的錯誤(GH 50467

  • DataFrame.sort_values()中,當by是空列表且inplace=True時,未返回None的錯誤(GH 50643

  • DataFrame.loc()中,當使用列表索引器設定值時,會強制轉換dtype的錯誤(GH 49159

  • Series.loc()中,當使用越界切片索引器時會引發錯誤的錯誤(GH 50161

  • DataFrame.loc()中,當布林索引器全部為False且物件為空時,會引發ValueError的錯誤(GH 51450

  • DataFrame.loc()中,當布林索引器和MultiIndex同時存在時,會引發ValueError的錯誤(GH 47687

  • DataFrame.loc()中,當使用非標量索引器為pyarrow支援的列設定值時,會引發IndexError的錯誤(GH 50085

  • DataFrame.__getitem__(), Series.__getitem__(), DataFrame.__setitem__()Series.__setitem__() 中,當使用整數索引浮點數(Float64 & Float64)或複數dtypet的索引時,會引發錯誤的錯誤(GH 51053

  • DataFrame.loc()中,當使用空索引器設定不相容的值時,會修改物件的錯誤(GH 45981

  • DataFrame.__setitem__()中,當右側是具有MultiIndex列的DataFrame時,會引發ValueError的錯誤(GH 49121

  • DataFrame.reindex()中,當DataFrame具有單個extension array列時,在重新索引columnsindex時,會將dtype強制轉換為object的錯誤(GH 48190

  • DataFrame.iloc()中,當索引器是具有numeric extension array dtype的Series時,會引發IndexError的錯誤(GH 49521

  • describe()中,格式化結果索引中的百分位數時,顯示的小數位數過多(GH 46362

  • DataFrame.compare()中,當比較nullable dtypes中的NA與值時,不識別差異的錯誤(GH 48939

  • Series.rename()中使用MultiIndex時,丟失extension array dtypes的錯誤(GH 21055

  • DataFrame.isetitem()中,當DataFrame中的extension array dtypes被強制轉換為object時,會引發錯誤的錯誤(GH 49922

  • Series.__getitem__()中,當從空的pyarrow支援的物件中選擇時,返回損壞物件的錯誤(GH 51734

  • BusinessHour中,當索引中未包含開盤時間時,會導致DatetimeIndex建立失敗的錯誤(GH 49835

Missing#

  • Index.equals()中,當Index由包含NA的元組組成時,會引發TypeError的錯誤(GH 48446

  • Series.map()中,當資料包含NaN且使用了defaultdict對映時,導致結果不正確的錯誤(GH 48813

  • NA中,當與bytes物件執行二元運算時,返回NA而不是引發TypeError的錯誤(GH 49108

  • DataFrame.update()中,當overwrite=False時,如果self的列包含NaT值且該列不在other中,會引發TypeError的錯誤(GH 16713

  • Series.replace()中,當在包含NA的object-dtype Series中替換值時,會引發RecursionError的錯誤(GH 47480

  • Series.replace()中,當在帶有NA的numeric Series中替換值時,會引發RecursionError的錯誤(GH 50758

MultiIndex#

I/O#

  • read_sas()中,導致DataFrame碎片化並引發errors.PerformanceWarning的錯誤(GH 48595

  • read_excel()中,當在讀取檔案時發生異常時,透過包含有問題的表名來改進錯誤訊息(GH 48706

  • 在序列化部分PyArrow支援的資料時,會序列化整個資料而不是子集,從而導致錯誤(GH 42600

  • 在指定了 `chunksize` 且結果為空時,`read_sql_query()` 函式中的 `dtype` 引數被忽略的錯誤(GH 50245

  • 當使用 `engine="c"` 讀取單行 CSV 檔案,且該檔案列數少於 `names` 指定的列數時,`read_csv()` 函式丟擲 `pandas.errors.ParserError` 錯誤的 bug(GH 47566

  • 在 `orient="table"` 和 `NA` 值存在時,`read_json()` 函式丟擲錯誤的 bug(GH 40255

  • 顯示 `string` dtypes 時未顯示儲存選項的 bug(GH 50099

  • 在 `header=False` 的情況下,`DataFrame.to_string()` 列印索引名稱與資料第一行在同一行的 bug(GH 49230

  • 在 `DataFrame.to_string()` 中忽略擴充套件陣列的浮點數格式化器的 bug(GH 39336

  • 修復了由於內部 JSON 模組初始化導致的記憶體洩漏問題(GH 49222

  • 修復了 `json_normalize()` 函式在 `sep` 引數匹配時,錯誤地刪除了列名開頭字元的問題(GH 49861

  • 在 `engine="pyarrow"` 的情況下,`read_csv()` 函式在包含 `NA` 值的擴充套件陣列 dtype 時,不必要地溢位的 bug(GH 32134

  • 在 `DataFrame.to_dict()` 中,`NA` 未被轉換為 `None` 的 bug(GH 50795

  • 在 `DataFrame.to_json()` 中,當無法編碼字串時會發生段錯誤(segfault)的 bug(GH 50307

  • 在 `DataFrame.to_html()` 中,當 `DataFrame` 包含非標量資料且設定了 `na_rep` 時,會出現 bug(GH 47103

  • 在 `read_xml()` 中,使用 `iterparse` 時,檔案物件出現問題的 bug(GH 50641

  • 在 `read_csv()` 中,當 `engine="pyarrow"` 時,`encoding` 引數未被正確處理的 bug(GH 51302

  • 在 `read_xml()` 中,使用 `iterparse` 時,重複的元素被忽略的 bug(GH 51183

  • 在 `ExcelWriter()` 例項化過程中發生異常時,未關閉檔案控制代碼的 bug(GH 51443

  • 在 `DataFrame.to_parquet()` 中,當 `engine="pyarrow"` 時,非字串索引或列會引發 `ValueError` 的 bug(GH 52036

Period#

  • 在 `Period.strftime()` 和 `PeriodIndex.strftime()` 中,當傳入區域設定特定的指令時,會丟擲 `UnicodeDecodeError` 的 bug(GH 46319

  • 在將 `Period` 物件新增到 `DateOffset` 物件陣列時,會錯誤地丟擲 `TypeError` 的 bug(GH 50162

  • 在 `Period` 中,當傳入比納秒更精細解析度的字串時,會引發 `KeyError` 而不是丟棄額外精度(GH 50417

  • 解析表示周(Week)週期的字串(例如 "2017-01-23/2017-01-29")時,將其解析為分鐘頻率而不是周頻率的 bug(GH 50803

  • 在 `DataFrameGroupBy.sum()`、`DataFrameGroupByGroupBy.cumsum()`、`DataFrameGroupByGroupBy.prod()`、`DataFrameGroupByGroupBy.cumprod()` 使用 `PeriodDtype` 時,未能丟擲 `TypeError` 的 bug(GH 51040

  • 在解析空字串時,`Period` 會錯誤地丟擲 `ValueError` 而不是返回 `NaT` 的 bug(GH 51349

繪圖#

  • 在 `DataFrame.plot.hist()` 中,未丟棄與 `data` 中 `NaN` 值對應的 `weights` 元素(GH 48884

  • `ax.set_xlim` 有時會引發 `UserWarning`,因為 `set_xlim` 不接受解析引數,這使得使用者無法解決。現在轉換器使用 `Timestamp()` 代替(GH 49148

Groupby/resample/rolling#

  • 在 `ExponentialMovingWindow` 的 `online` 模式下,對於不支援的操作未能丟擲 `NotImplementedError` 的 bug(GH 48834

  • 當物件為空時,`DataFrameGroupBy.sample()` 丟擲 `ValueError` 的 bug(GH 48459

  • 當 `Series.groupby()` 的索引中的一個條目等於索引的名稱時,會丟擲 `ValueError` 的 bug(GH 48567

  • 當傳入空的 DataFrame 時,`DataFrameGroupBy.resample()` 產生不一致結果的 bug(GH 47705

  • 在按分類索引分組時,`DataFrameGroupBy` 和 `SeriesGroupBy` 不會在結果中包含未觀察到的類別的 bug(GH 49354

  • 在按分類資料分組時,`DataFrameGroupBy` 和 `SeriesGroupBy` 的結果順序會根據輸入索引而改變的 bug(GH 49223

  • 當與 `sort=False` 一起使用時,`DataFrameGroupBy` 和 `SeriesGroupBy` 在按分類資料分組時仍會排序結果值的 bug(GH 42482

  • 在 `DataFrameGroupBy.apply()` 和 `SeriesGroupBy.apply` 中,當使用 `as_index=False` 時,如果使用分組鍵導致 `TypeError`,函式不會在不使用分組鍵的情況下嘗試計算的 bug(GH 49256

  • 在 `DataFrameGroupBy.describe()` 中,會描述分組鍵的 bug(GH 49256

  • 在 `SeriesGroupBy.describe()` 中,當 `as_index=False` 時,形狀不正確的 bug(GH 49256

  • 在 `DataFrameGroupBy` 和 `SeriesGroupBy` 中,當 `dropna=False` 且分組器是分類的時,會丟棄 NA 值的 bug(GH 36327

  • 在 `SeriesGroupBy.nunique()` 中,當分組器是空的分類且 `observed=True` 時,會錯誤地丟擲異常的 bug(GH 21334

  • 在 `SeriesGroupBy.nth()` 中,當從 `DataFrameGroupBy` 中子集化後分組器包含 NA 值時,會丟擲異常的 bug(GH 26454

  • 在 `DataFrame.groupby()` 中,當 `as_index=False` 時,由 `key` 指定的 `Grouper` 不會被包含在結果中的 bug(GH 50413

  • 在 `DataFrameGroupBy.value_counts()` 中,當與 `TimeGrouper` 一起使用時會丟擲異常的 bug(GH 50486

  • `Resampler.size()` 返回了一個寬的 `DataFrame` 而不是帶 `MultiIndex` 的 `Series` 的 bug(GH 46826

  • 在 `DataFrameGroupBy.transform()` 和 `SeriesGroupBy.transform()` 中,當分組器具有 `axis=1` 時,對於 `"idxmin"` 和 `"idxmax"` 引數會錯誤地丟擲異常的 bug(GH 45986

  • 當使用空的 DataFrame、分類分組器和 `dropna=False` 時,`DataFrameGroupBy` 會丟擲異常的 bug(GH 50634

  • 在 `SeriesGroupBy.value_counts()` 中,未遵守 `sort=False` 的 bug(GH 50482

  • 在 `DataFrameGroupBy.resample()` 中,當從鍵列表中獲取結果時,對時間索引進行重取樣會引發 `KeyError` 的 bug(GH 50840

  • 在 `DataFrameGroupBy.transform()` 和 `SeriesGroupBy.transform()` 中,當分組器具有 `axis=1` 時,對於 `"ngroup"` 引數會錯誤地丟擲異常的 bug(GH 45986

  • 在 `DataFrameGroupBy.describe()` 中,當資料具有重複列時,產生不正確結果的 bug(GH 50806

  • 在 `DataFrameGroupBy.agg()` 中,當 `engine="numba"` 時,未能遵守 `as_index=False` 的 bug(GH 51228

  • 在 `DataFrameGroupBy.agg()`、`SeriesGroupBy.agg()` 和 `Resampler.agg()` 中,當傳入函式列表時會忽略引數的 bug(GH 50863

  • 在 `DataFrameGroupBy.ohlc()` 中,忽略 `as_index=False` 的 bug(GH 51413

  • 在 `DataFrameGroupBy.agg()` 中,在子集化列後(例如 `.groupby(...)[["a", "b"]]`),結果中不包含分組的 bug(GH 51186

Reshaping#

  • 在 `DataFrame.pivot_table()` 中,對於可為空的 dtype 和 `margins=True`,會引發 `TypeError` 的 bug(GH 48681

  • 在 `DataFrame.unstack()` 和 `Series.unstack()` 中,當 `MultiIndex` 具有混合名稱時,unstack 錯誤的 `MultiIndex` 級別的 bug(GH 48763

  • 在 `DataFrame.melt()` 中,丟失擴充套件陣列 dtype 的 bug(GH 41570

  • 在 `DataFrame.pivot()` 中,未遵守 `None` 作為列名的 bug(GH 48293

  • 在 `DataFrame.join()` 中,當 `left_on` 或 `right_on` 是或包含 `CategoricalIndex` 時,會錯誤地引發 `AttributeError` 的 bug(GH 48464

  • 在 `DataFrame.pivot_table()` 中,當結果是空的 `DataFrame` 時,使用 `margins=True` 引數會引發 `ValueError` 的 bug(GH 49240

  • 澄清了在 `merge()` 中傳遞無效 `validate` 選項時的錯誤訊息(GH 49417

  • 在 `DataFrame.explode()` 中,對於多個帶有 `NaN` 值或空列表的列,會引發 `ValueError` 的 bug(GH 46084

  • 在 `DataFrame.transpose()` 中,當列是 `IntervalDtype` 且端點是 `timedelta64[ns]` 時的 bug(GH 44917

  • 在 `DataFrame.agg()` 和 `Series.agg()` 中,當傳入函式列表時會忽略引數的 bug(GH 50863

Sparse#

  • 在 `Series.astype()` 中,當將具有 `datetime64[ns]` 子型別的 `SparseDtype` 轉換為 `int64` dtype 時,會引發錯誤,這與非稀疏行為不一致(GH 49631,:issue:50087

  • 在 `Series.astype()` 中,從 `datetime64[ns]` 轉換為 `Sparse[datetime64[ns]]` 時,會錯誤地引發異常(GH 50082

  • 在 `Series.sparse.to_coo()` 中,當 `MultiIndex` 包含 `ExtensionArray` 時,會引發 `SystemError` 的 bug(GH 50996

ExtensionArray#

  • 在 `Series.mean()` 中,對於可為空的整數,會不必要地溢位的 bug(GH 48378

  • 在 `Series.tolist()` 中,對於可為空的 dtypes,返回 NumPy 標量而不是 Python 標量的 bug(GH 49890

  • 在 `Series.round()` 中,對於 pyarrow 支援的 dtypes,會引發 `AttributeError` 的 bug(GH 50437

  • 當將一個空的 DataFrame 與具有 `ExtensionDtype` 的另一個 DataFrame 連線時,結果的 dtype 變成了 `object` 的 bug(GH 48510

  • 在 `array.PandasArray.to_numpy()` 中,當指定 `na_value` 時,遇到 `NA` 值會引發異常的 bug(GH 40638

  • 在 `api.types.is_numeric_dtype()` 中,當自定義 `ExtensionDtype` 的 `_is_numeric` 返回 `True` 時,它不會返回 `True` 的 bug(GH 50563

  • 在 `api.types.is_integer_dtype()`、`api.types.is_unsigned_integer_dtype()`、`api.types.is_signed_integer_dtype()`、`api.types.is_float_dtype()` 中,當自定義 `ExtensionDtype` 的 `kind` 返回相應的 NumPy 型別時,它不會返回 `True` 的 bug(GH 50667

  • Series建構函式中存在錯誤,對於可空無符號整數資料型別(GH 38798、GH 25880)出現了不必要的溢位

  • 在將非字串值設定為 StringArray 時,存在錯誤,會引發 ValueError 而不是 TypeError(GH 49632)

  • DataFrame.reindex() 中存在錯誤,在處理具有 ExtensionDtype 的列時,未遵循預設的 copy=True 關鍵字(因此,使用 getitem([])選擇多列時也不會正確地生成副本)(GH 51197)

  • ArrowExtensionArray 的邏輯運算 & 和 | 中存在錯誤,會引發 KeyError(GH 51688)

Styler

  • 修復了 background_gradient() 對於具有 NA 值且資料型別可為空的 Series(GH 50712)

元資料#

  • 修復了 DataFrame.corr() 和 DataFrame.cov() 中元資料傳播的錯誤(GH 28283)

其他#

  • 存在錯誤,會錯誤地接受包含“[pyarrow]”兩次或以上的資料型別字串(GH 51548)

  • Series.searchsorted() 中存在錯誤,當將 DataFrame 作為引數 value 接受時,行為不一致(GH 49620)

  • array() 中存在錯誤,未能對 DataFrame 輸入引發錯誤(GH 51167)

貢獻者#

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

  • 5j9 +

  • ABCPAN-rank +

  • Aarni Koskela +

  • Aashish KC +

  • Abubeker Mohammed +

  • Adam Mróz +

  • Adam Ormondroyd +

  • Aditya Anulekh +

  • Ahmed Ibrahim

  • Akshay Babbar +

  • Aleksa Radojicic +

  • Alex +

  • Alex Buzenet +

  • Alex Kirko

  • Allison Kwan +

  • Amay Patel +

  • Ambuj Pawar +

  • Amotz +

  • Andreas Schwab +

  • Andrew Chen +

  • Anton Shevtsov

  • Antonio Ossa Guerra +

  • Antonio Ossa-Guerra +

  • Anushka Bishnoi +

  • Arda Kosar

  • Armin Berres

  • Asadullah Naeem +

  • Asish Mahapatra

  • Bailey Lissington +

  • BarkotBeyene

  • Ben Beasley

  • Bhavesh Rajendra Patil +

  • Bibek Jha +

  • Bill +

  • Bishwas +

  • CarlosGDCJ +

  • Carlotta Fabian +

  • Chris Roth +

  • Chuck Cadman +

  • Corralien +

  • DG +

  • Dan Hendry +

  • Daniel Isaac

  • David Kleindienst +

  • David Poznik +

  • David Rudel +

  • DavidKleindienst +

  • Dea María Léon +

  • Deepak Sirohiwal +

  • Dennis Chukwunta

  • Douglas Lohmann +

  • Dries Schaumont

  • Dustin K +

  • Edoardo Abati +

  • Eduardo Chaves +

  • Ege Özgüroğlu +

  • Ekaterina Borovikova +

  • Eli Schwartz +

  • Elvis Lim +

  • Emily Taylor +

  • Emma Carballal Haire +

  • Erik Welch +

  • Fangchen Li

  • Florian Hofstetter +

  • Flynn Owen +

  • Fredrik Erlandsson +

  • Gaurav Sheni

  • Georeth Chow +

  • George Munyoro +

  • Guilherme Beltramini

  • Gulnur Baimukhambetova +

  • H L +

  • Hans

  • Hatim Zahid +

  • HighYoda +

  • Hiki +

  • Himanshu Wagh +

  • Hugo van Kemenade +

  • Idil Ismiguzel +

  • Irv Lustig

  • Isaac Chung

  • Isaac Virshup

  • JHM Darbyshire

  • JHM Darbyshire (iMac)

  • JMBurley

  • Jaime Di Cristina

  • Jan Koch

  • JanVHII +

  • Janosh Riebesell

  • JasmandeepKaur +

  • Jeremy Tuloup

  • Jessica M +

  • Jonas Haag

  • Joris Van den Bossche

  • João Meirelles +

  • Julia Aoun +

  • Justus Magin +

  • Kang Su Min +

  • Kevin Sheppard

  • Khor Chean Wei

  • Kian Eliasi

  • Kostya Farber +

  • KotlinIsland +

  • Lakmal Pinnaduwage +

  • Lakshya A Agrawal +

  • Lawrence Mitchell +

  • Levi Ob +

  • Loic Diridollou

  • Lorenzo Vainigli +

  • Luca Pizzini +

  • Lucas Damo +

  • Luke Manley

  • Madhuri Patil +

  • Marc Garcia

  • Marco Edward Gorelli

  • Marco Gorelli

  • MarcoGorelli

  • Maren Westermann +

  • Maria Stazherova +

  • Marie K +

  • Marielle +

  • Mark Harfouche +

  • Marko Pacak +

  • Martin +

  • Matheus Cerqueira +

  • Matheus Pedroni +

  • Matteo Raso +

  • Matthew Roeschke

  • MeeseeksMachine +

  • Mehdi Mohammadi +

  • Michael Harris +

  • Michael Mior +

  • Natalia Mokeeva +

  • Neal Muppidi +

  • Nick Crews

  • Nishu Choudhary +

  • Noa Tamir

  • Noritada Kobayashi

  • Omkar Yadav +

  • P. Talley +

  • Pablo +

  • Pandas Development Team

  • Parfait Gasana

  • Patrick Hoefler

  • Pedro Nacht +

  • Philip +

  • Pietro Battiston

  • Pooja Subramaniam +

  • Pranav Saibhushan Ravuri +

  • Pranav. P. A +

  • Ralf Gommers +

  • RaphSku +

  • Richard Shadrach

  • Robsdedude +

  • Roger

  • Roger Thomas

  • RogerThomas +

  • SFuller4 +

  • Salahuddin +

  • Sam Rao

  • Sean Patrick Malloy +

  • Sebastian Roll +

  • Shantanu

  • Shashwat +

  • Shashwat Agrawal +

  • Shiko Wamwea +

  • Shoham Debnath

  • Shubhankar Lohani +

  • Siddhartha Gandhi +

  • Simon Hawkins

  • Soumik Dutta +

  • Sowrov Talukder +

  • Stefanie Molin

  • Stefanie Senger +

  • Stepfen Shawn +

  • Steven Rotondo

  • Stijn Van Hoey

  • Sudhansu +

  • Sven

  • Sylvain MARIE

  • Sylvain Marié

  • Tabea Kossen +

  • Taylor Packard

  • Terji Petersen

  • Thierry Moisan

  • Thomas H +

  • Thomas Li

  • Torsten Wörtwein

  • Tsvika S +

  • Tsvika Shapira +

  • Vamsi Verma +

  • Vinicius Akira +

  • William Andrea

  • William Ayd

  • William Blum +

  • Wilson Xing +

  • Xiao Yuan +

  • Xnot +

  • Yasin Tatar +

  • Yuanhao Geng

  • Yvan Cywan +

  • Zachary Moon +

  • Zhengbo Wang +

  • abonte +

  • adrienpacifico +

  • alm

  • amotzop +

  • andyjessen +

  • anonmouse1 +

  • bang128 +

  • bishwas jha +

  • calhockemeyer +

  • carla-alves-24 +

  • carlotta +

  • casadipietra +

  • catmar22 +

  • cfabian +

  • codamuse +

  • dataxerik

  • davidleon123 +

  • dependabot[bot] +

  • fdrocha +

  • github-actions[bot]

  • himanshu_wagh +

  • iofall +

  • jakirkham +

  • jbrockmendel

  • jnclt +

  • joelchen +

  • joelsonoda +

  • joshuabello2550

  • joycewamwea +

  • kathleenhang +

  • krasch +

  • ltoniazzi +

  • luke396 +

  • milosz-martynow +

  • minat-hub +

  • mliu08 +

  • monosans +

  • nealxm

  • nikitaved +

  • paradox-lab +

  • partev

  • raisadz +

  • ram vikram singh +

  • rebecca-palmer

  • sarvaSanjay +

  • seljaks +

  • silviaovo +

  • smij720 +

  • soumilbaldota +

  • stellalin7 +

  • strawberry beach sandals +

  • tmoschou +

  • uzzell +

  • yqyqyq-W +

  • yun +

  • Ádám Lippai

  • 김동현 (Daniel Donghyun Kim) +