Skip to content

Commit 9a90fa0

Browse files
Merge branch 'main' into scott/bodo_udf_engine
2 parents cd94be9 + 5c9b671 commit 9a90fa0

File tree

100 files changed

+1477
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1477
-473
lines changed

.github/workflows/wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
buildplat:
9595
- [ubuntu-22.04, manylinux_x86_64]
9696
- [ubuntu-22.04, musllinux_x86_64]
97-
- [macos-12, macosx_x86_64]
97+
- [macos-13, macosx_x86_64]
9898
# Note: M1 images on Github Actions start from macOS 14
9999
- [macos-14, macosx_arm64]
100100
- [windows-2022, win_amd64]

.pre-commit-config.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.8.1
22+
rev: v0.8.6
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -34,7 +34,7 @@ repos:
3434
- id: ruff-format
3535
exclude: ^scripts|^pandas/tests/frame/test_query_eval.py
3636
- repo: https://github.com/jendrikseipp/vulture
37-
rev: 'v2.13'
37+
rev: 'v2.14'
3838
hooks:
3939
- id: vulture
4040
entry: python scripts/run_vulture.py
@@ -74,7 +74,7 @@ repos:
7474
hooks:
7575
- id: isort
7676
- repo: https://github.com/asottile/pyupgrade
77-
rev: v3.19.0
77+
rev: v3.19.1
7878
hooks:
7979
- id: pyupgrade
8080
args: [--py310-plus]
@@ -95,12 +95,17 @@ repos:
9595
- id: sphinx-lint
9696
args: ["--enable", "all", "--disable", "line-too-long"]
9797
- repo: https://github.com/pre-commit/mirrors-clang-format
98-
rev: v19.1.4
98+
rev: v19.1.6
9999
hooks:
100100
- id: clang-format
101101
files: ^pandas/_libs/src|^pandas/_libs/include
102102
args: [-i]
103103
types_or: [c, c++]
104+
- repo: https://github.com/trim21/pre-commit-mirror-meson
105+
rev: v1.6.1
106+
hooks:
107+
- id: meson-fmt
108+
args: ['--inplace']
104109
- repo: local
105110
hooks:
106111
- id: pyright

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BSD 3-Clause License
33
Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
44
All rights reserved.
55

6-
Copyright (c) 2011-2024, Open source contributors.
6+
Copyright (c) 2011-2025, Open source contributors.
77

88
Redistribution and use in source and binary forms, with or without
99
modification, are permitted provided that the following conditions are met:

asv_bench/benchmarks/io/csv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ def setup(self):
594594
self.StringIO_input = StringIO(data)
595595

596596
def time_read_csv_index_col(self):
597-
read_csv(self.StringIO_input, index_col="a")
597+
read_csv(self.data(self.StringIO_input), index_col="a")
598598

599599

600600
class ReadCSVDatePyarrowEngine(StringIORewind):
@@ -605,7 +605,7 @@ def setup(self):
605605

606606
def time_read_csv_index_col(self):
607607
read_csv(
608-
self.StringIO_input,
608+
self.data(self.StringIO_input),
609609
parse_dates=["a"],
610610
engine="pyarrow",
611611
dtype_backend="pyarrow",

ci/code_checks.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8181
-i "pandas.Timestamp.resolution PR02" \
8282
-i "pandas.Timestamp.tzinfo GL08" \
8383
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
84-
-i "pandas.arrays.NumpyExtensionArray SA01" \
8584
-i "pandas.arrays.TimedeltaArray PR07,SA01" \
8685
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
8786
-i "pandas.core.groupby.SeriesGroupBy.plot PR02" \
88-
-i "pandas.core.resample.Resampler.max PR01,RT03,SA01" \
89-
-i "pandas.core.resample.Resampler.mean SA01" \
90-
-i "pandas.core.resample.Resampler.min PR01,RT03,SA01" \
91-
-i "pandas.core.resample.Resampler.prod SA01" \
9287
-i "pandas.core.resample.Resampler.quantile PR01,PR07" \
93-
-i "pandas.core.resample.Resampler.std SA01" \
9488
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
95-
-i "pandas.core.resample.Resampler.var SA01" \
96-
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
9789
-i "pandas.plotting.andrews_curves RT03,SA01" \
9890
-i "pandas.tseries.offsets.BDay PR02,SA01" \
9991
-i "pandas.tseries.offsets.BQuarterBegin.is_on_offset GL08" \
507 KB
Binary file not shown.
119 KB
Binary file not shown.

doc/cheatsheet/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ and pick "PDF" as the format.
66

77
This cheat sheet, originally written by Irv Lustig, [Princeton Consultants](https://www.princetonoptimization.com/), was inspired by the [RStudio Data Wrangling Cheatsheet](https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf).
88

9-
| Topic | PDF | PPT |
10-
|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
11-
| Pandas_Cheat_Sheet | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet.pdf" target="_parent"><img src="https://img.shields.io/badge/Open in PDF-%23FF0000.svg?style=flat-square&logo=adobe&logoColor=white"/></a> | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet.pptx" target="_parent"><img src="https://img.shields.io/badge/Open in PPT-B7472A?style=flat-square&logo=microsoft-powerpoint&logoColor=white"/></a> |
12-
| Pandas_Cheat_Sheet_JA | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pdf" target="_parent"><img src="https://img.shields.io/badge/Open in PDF-%23FF0000.svg?style=flat-square&logo=adobe&logoColor=white"/></a> | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pptx" target="_parent"><img src="https://img.shields.io/badge/Open in PPT-B7472A?style=flat-square&logo=microsoft-powerpoint&logoColor=white"/></a> |
9+
| Topic | Language | PDF | PPT |
10+
|------------------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
11+
| Pandas_Cheat_Sheet | English | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet.pdf" target="_parent"><img src="https://img.shields.io/badge/Open in PDF-%23FF0000.svg?style=flat-square&logo=adobe&logoColor=white"/></a> | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet.pptx" target="_parent"><img src="https://img.shields.io/badge/Open in PPT-B7472A?style=flat-square&logo=microsoft-powerpoint&logoColor=white"/></a> |
12+
| Pandas_Cheat_Sheet_JA | Japanese | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pdf" target="_parent"><img src="https://img.shields.io/badge/Open in PDF-%23FF0000.svg?style=flat-square&logo=adobe&logoColor=white"/></a> | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_JA.pptx" target="_parent"><img src="https://img.shields.io/badge/Open in PPT-B7472A?style=flat-square&logo=microsoft-powerpoint&logoColor=white"/></a> |
13+
| Pandas_Cheat_Sheet_FA | Persian | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_FA.pdf" target="_parent"><img src="https://img.shields.io/badge/Open in PDF-%23FF0000.svg?style=flat-square&logo=adobe&logoColor=white"/></a> | <a href="https://github.com/pandas-dev/pandas/blob/main/doc/cheatsheet/Pandas_Cheat_Sheet_FA.pptx" target="_parent"><img src="https://img.shields.io/badge/Open in PPT-B7472A?style=flat-square&logo=microsoft-powerpoint&logoColor=white"/></a> |
14+
1315

1416

1517
**Alternative**

doc/source/reference/window.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Rolling window functions
3535
Rolling.skew
3636
Rolling.kurt
3737
Rolling.apply
38+
Rolling.pipe
3839
Rolling.aggregate
3940
Rolling.quantile
4041
Rolling.sem
@@ -76,6 +77,7 @@ Expanding window functions
7677
Expanding.skew
7778
Expanding.kurt
7879
Expanding.apply
80+
Expanding.pipe
7981
Expanding.aggregate
8082
Expanding.quantile
8183
Expanding.sem

doc/source/user_guide/indexing.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,10 @@ and :ref:`Advanced Indexing <advanced>` you may select along more than one axis
858858
859859
.. warning::
860860

861-
``iloc`` supports two kinds of boolean indexing. If the indexer is a boolean ``Series``,
862-
an error will be raised. For instance, in the following example, ``df.iloc[s.values, 1]`` is ok.
863-
The boolean indexer is an array. But ``df.iloc[s, 1]`` would raise ``ValueError``.
861+
While ``loc`` supports two kinds of boolean indexing, ``iloc`` only supports indexing with a
862+
boolean array. If the indexer is a boolean ``Series``, an error will be raised. For instance,
863+
in the following example, ``df.iloc[s.values, 1]`` is ok. The boolean indexer is an array.
864+
But ``df.iloc[s, 1]`` would raise ``ValueError``.
864865

865866
.. ipython:: python
866867

doc/source/user_guide/io.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,6 +2340,7 @@ Read a URL with no options:
23402340
.. code-block:: ipython
23412341
23422342
In [320]: url = "https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list"
2343+
23432344
In [321]: pd.read_html(url)
23442345
Out[321]:
23452346
[ Bank NameBank CityCity StateSt ... Acquiring InstitutionAI Closing DateClosing FundFund
@@ -2366,6 +2367,7 @@ Read a URL while passing headers alongside the HTTP request:
23662367
.. code-block:: ipython
23672368
23682369
In [322]: url = 'https://www.sump.org/notes/request/' # HTTP request reflector
2370+
23692371
In [323]: pd.read_html(url)
23702372
Out[323]:
23712373
[ 0 1
@@ -2378,14 +2380,16 @@ Read a URL while passing headers alongside the HTTP request:
23782380
1 Host: www.sump.org
23792381
2 User-Agent: Python-urllib/3.8
23802382
3 Connection: close]
2383+
23812384
In [324]: headers = {
2382-
In [325]: 'User-Agent':'Mozilla Firefox v14.0',
2383-
In [326]: 'Accept':'application/json',
2384-
In [327]: 'Connection':'keep-alive',
2385-
In [328]: 'Auth':'Bearer 2*/f3+fe68df*4'
2386-
In [329]: }
2387-
In [340]: pd.read_html(url, storage_options=headers)
2388-
Out[340]:
2385+
.....: 'User-Agent':'Mozilla Firefox v14.0',
2386+
.....: 'Accept':'application/json',
2387+
.....: 'Connection':'keep-alive',
2388+
.....: 'Auth':'Bearer 2*/f3+fe68df*4'
2389+
.....: }
2390+
2391+
In [325]: pd.read_html(url, storage_options=headers)
2392+
Out[325]:
23892393
[ 0 1
23902394
0 Remote Socket: 51.15.105.256:51760
23912395
1 Protocol Version: HTTP/1.1

doc/source/user_guide/visualization.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,11 +1210,6 @@ You may set the ``xlabel`` and ``ylabel`` arguments to give the plot custom labe
12101210
for x and y axis. By default, pandas will pick up index name as xlabel, while leaving
12111211
it empty for ylabel.
12121212

1213-
.. ipython:: python
1214-
:suppress:
1215-
1216-
plt.figure();
1217-
12181213
.. ipython:: python
12191214
12201215
df.plot();

doc/source/whatsnew/v2.3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Other enhancements
3535
- The semantics for the ``copy`` keyword in ``__array__`` methods (i.e. called
3636
when using ``np.array()`` or ``np.asarray()`` on pandas objects) has been
3737
updated to work correctly with NumPy >= 2 (:issue:`57739`)
38+
- The :meth:`~Series.cumsum`, :meth:`~Series.cummin`, and :meth:`~Series.cummax` reductions are now implemented for ``StringDtype`` columns when backed by PyArrow (:issue:`60633`)
3839
- The :meth:`~Series.sum` reduction is now implemented for ``StringDtype`` columns (:issue:`59853`)
39-
-
4040

4141
.. ---------------------------------------------------------------------------
4242
.. _whatsnew_230.notable_bug_fixes:

doc/source/whatsnew/v3.0.0.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Other enhancements
3030
^^^^^^^^^^^^^^^^^^
3131
- :class:`pandas.api.typing.FrozenList` is available for typing the outputs of :attr:`MultiIndex.names`, :attr:`MultiIndex.codes` and :attr:`MultiIndex.levels` (:issue:`58237`)
3232
- :class:`pandas.api.typing.SASReader` is available for typing the output of :func:`read_sas` (:issue:`55689`)
33+
- :class:`pandas.api.typing.NoDefault` is available for typing ``no_default``
3334
- :func:`DataFrame.to_excel` now raises an ``UserWarning`` when the character count in a cell exceeds Excel's limitation of 32767 characters (:issue:`56954`)
3435
- :func:`pandas.merge` now validates the ``how`` parameter input (merge type) (:issue:`59435`)
3536
- :func:`read_spss` now supports kwargs to be passed to pyreadstat (:issue:`56356`)
@@ -44,22 +45,26 @@ Other enhancements
4445
- Users can globally disable any ``PerformanceWarning`` by setting the option ``mode.performance_warnings`` to ``False`` (:issue:`56920`)
4546
- :meth:`Styler.format_index_names` can now be used to format the index and column names (:issue:`48936` and :issue:`47489`)
4647
- :class:`.errors.DtypeWarning` improved to include column names when mixed data types are detected (:issue:`58174`)
48+
- :class:`Rolling` and :class:`Expanding` now support ``pipe`` method (:issue:`57076`)
4749
- :class:`Series` now supports the Arrow PyCapsule Interface for export (:issue:`59518`)
4850
- :func:`DataFrame.to_excel` argument ``merge_cells`` now accepts a value of ``"columns"`` to only merge :class:`MultiIndex` column header header cells (:issue:`35384`)
4951
- :meth:`DataFrame.corrwith` now accepts ``min_periods`` as optional arguments, as in :meth:`DataFrame.corr` and :meth:`Series.corr` (:issue:`9490`)
5052
- :meth:`DataFrame.cummin`, :meth:`DataFrame.cummax`, :meth:`DataFrame.cumprod` and :meth:`DataFrame.cumsum` methods now have a ``numeric_only`` parameter (:issue:`53072`)
5153
- :meth:`DataFrame.ewm` now allows ``adjust=False`` when ``times`` is provided (:issue:`54328`)
5254
- :meth:`DataFrame.fillna` and :meth:`Series.fillna` can now accept ``value=None``; for non-object dtype the corresponding NA value will be used (:issue:`57723`)
5355
- :meth:`DataFrame.pivot_table` and :func:`pivot_table` now allow the passing of keyword arguments to ``aggfunc`` through ``**kwargs`` (:issue:`57884`)
56+
- :meth:`DataFrame.to_json` now encodes ``Decimal`` as strings instead of floats (:issue:`60698`)
5457
- :meth:`Series.cummin` and :meth:`Series.cummax` now supports :class:`CategoricalDtype` (:issue:`52335`)
5558
- :meth:`Series.plot` now correctly handle the ``ylabel`` parameter for pie charts, allowing for explicit control over the y-axis label (:issue:`58239`)
5659
- :meth:`DataFrame.plot.scatter` argument ``c`` now accepts a column of strings, where rows with the same string are colored identically (:issue:`16827` and :issue:`16485`)
5760
- :func:`read_parquet` accepts ``to_pandas_kwargs`` which are forwarded to :meth:`pyarrow.Table.to_pandas` which enables passing additional keywords to customize the conversion to pandas, such as ``maps_as_pydicts`` to read the Parquet map data type as python dictionaries (:issue:`56842`)
61+
- :meth:`.DataFrameGroupBy.transform`, :meth:`.SeriesGroupBy.transform`, :meth:`.DataFrameGroupBy.agg`, :meth:`.SeriesGroupBy.agg`, :meth:`.SeriesGroupBy.apply`, :meth:`.DataFrameGroupBy.apply` now support ``kurt`` (:issue:`40139`)
5862
- :meth:`DataFrameGroupBy.transform`, :meth:`SeriesGroupBy.transform`, :meth:`DataFrameGroupBy.agg`, :meth:`SeriesGroupBy.agg`, :meth:`RollingGroupby.apply`, :meth:`ExpandingGroupby.apply`, :meth:`Rolling.apply`, :meth:`Expanding.apply`, :meth:`DataFrame.apply` with ``engine="numba"`` now supports positional arguments passed as kwargs (:issue:`58995`)
5963
- :meth:`Rolling.agg`, :meth:`Expanding.agg` and :meth:`ExponentialMovingWindow.agg` now accept :class:`NamedAgg` aggregations through ``**kwargs`` (:issue:`28333`)
6064
- :meth:`Series.map` can now accept kwargs to pass on to func (:issue:`59814`)
6165
- :meth:`pandas.concat` will raise a ``ValueError`` when ``ignore_index=True`` and ``keys`` is not ``None`` (:issue:`59274`)
6266
- :meth:`str.get_dummies` now accepts a ``dtype`` parameter to specify the dtype of the resulting DataFrame (:issue:`47872`)
67+
- Implemented :meth:`Series.str.isascii` and :meth:`Series.str.isascii` (:issue:`59091`)
6368
- Multiplying two :class:`DateOffset` objects will now raise a ``TypeError`` instead of a ``RecursionError`` (:issue:`59442`)
6469
- Restore support for reading Stata 104-format and enable reading 103-format dta files (:issue:`58554`)
6570
- Support passing a :class:`Iterable[Hashable]` input to :meth:`DataFrame.drop_duplicates` (:issue:`59237`)
@@ -684,6 +689,7 @@ MultiIndex
684689
- :meth:`DataFrame.melt` would not accept multiple names in ``var_name`` when the columns were a :class:`MultiIndex` (:issue:`58033`)
685690
- :meth:`MultiIndex.insert` would not insert NA value correctly at unified location of index -1 (:issue:`59003`)
686691
- :func:`MultiIndex.get_level_values` accessing a :class:`DatetimeIndex` does not carry the frequency attribute along (:issue:`58327`, :issue:`57949`)
692+
- Bug in :class:`DataFrame` arithmetic operations in case of unaligned MultiIndex columns (:issue:`60498`)
687693
-
688694

689695
I/O
@@ -797,6 +803,7 @@ Other
797803
- Bug in :meth:`Series.dt` methods in :class:`ArrowDtype` that were returning incorrect values. (:issue:`57355`)
798804
- Bug in :meth:`Series.rank` that doesn't preserve missing values for nullable integers when ``na_option='keep'``. (:issue:`56976`)
799805
- Bug in :meth:`Series.replace` and :meth:`DataFrame.replace` inconsistently replacing matching instances when ``regex=True`` and missing values are present. (:issue:`56599`)
806+
- Bug in :meth:`Series.replace` and :meth:`DataFrame.replace` throwing ``ValueError`` when ``regex=True`` and all NA values. (:issue:`60688`)
800807
- Bug in :meth:`Series.to_string` when series contains complex floats with exponents (:issue:`60405`)
801808
- Bug in :meth:`read_csv` where chained fsspec TAR file and ``compression="infer"`` fails with ``tarfile.ReadError`` (:issue:`60028`)
802809
- Bug in Dataframe Interchange Protocol implementation was returning incorrect results for data buffers' associated dtype, for string and datetime columns (:issue:`54781`)

0 commit comments

Comments
 (0)