Skip to content

Commit dfbde9b

Browse files
authored
Merge branch 'main' into fix-merge-attrs
2 parents a9de220 + 1bb264c commit dfbde9b

File tree

135 files changed

+2458
-604
lines changed

Some content is hidden

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

135 files changed

+2458
-604
lines changed

.github/workflows/unit-tests.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ defaults:
2222

2323
jobs:
2424
ubuntu:
25-
runs-on: ubuntu-22.04
25+
runs-on: ${{ matrix.platform }}
2626
timeout-minutes: 90
2727
strategy:
2828
matrix:
29+
platform: [ubuntu-22.04, ubuntu-24.04-arm]
2930
env_file: [actions-310.yaml, actions-311.yaml, actions-312.yaml]
3031
# Prevent the include jobs from overriding other jobs
3132
pattern: [""]
@@ -35,9 +36,11 @@ jobs:
3536
env_file: actions-311-downstream_compat.yaml
3637
pattern: "not slow and not network and not single_cpu"
3738
pytest_target: "pandas/tests/test_downstream.py"
39+
platform: ubuntu-22.04
3840
- name: "Minimum Versions"
3941
env_file: actions-310-minimum_versions.yaml
4042
pattern: "not slow and not network and not single_cpu"
43+
platform: ubuntu-22.04
4144
- name: "Locale: it_IT"
4245
env_file: actions-311.yaml
4346
pattern: "not slow and not network and not single_cpu"
@@ -48,6 +51,7 @@ jobs:
4851
# Also install it_IT (its encoding is ISO8859-1) but do not activate it.
4952
# It will be temporarily activated during tests with locale.setlocale
5053
extra_loc: "it_IT"
54+
platform: ubuntu-22.04
5155
- name: "Locale: zh_CN"
5256
env_file: actions-311.yaml
5357
pattern: "not slow and not network and not single_cpu"
@@ -58,25 +62,32 @@ jobs:
5862
# Also install zh_CN (its encoding is gb2312) but do not activate it.
5963
# It will be temporarily activated during tests with locale.setlocale
6064
extra_loc: "zh_CN"
65+
platform: ubuntu-22.04
6166
- name: "Future infer strings"
6267
env_file: actions-312.yaml
6368
pandas_future_infer_string: "1"
69+
platform: ubuntu-22.04
6470
- name: "Future infer strings (without pyarrow)"
6571
env_file: actions-311.yaml
6672
pandas_future_infer_string: "1"
73+
platform: ubuntu-22.04
6774
- name: "Pypy"
6875
env_file: actions-pypy-39.yaml
6976
pattern: "not slow and not network and not single_cpu"
7077
test_args: "--max-worker-restart 0"
78+
platform: ubuntu-22.04
7179
- name: "Numpy Dev"
7280
env_file: actions-311-numpydev.yaml
7381
pattern: "not slow and not network and not single_cpu"
7482
test_args: "-W error::DeprecationWarning -W error::FutureWarning"
83+
platform: ubuntu-22.04
7584
- name: "Pyarrow Nightly"
7685
env_file: actions-311-pyarrownightly.yaml
7786
pattern: "not slow and not network and not single_cpu"
87+
pandas_future_infer_string: "1"
88+
platform: ubuntu-22.04
7889
fail-fast: false
79-
name: ${{ matrix.name || format('ubuntu-latest {0}', matrix.env_file) }}
90+
name: ${{ matrix.name || format('{0} {1}', matrix.platform, matrix.env_file) }}
8091
env:
8192
PATTERN: ${{ matrix.pattern }}
8293
LANG: ${{ matrix.lang || 'C.UTF-8' }}
@@ -91,7 +102,7 @@ jobs:
91102
REMOVE_PYARROW: ${{ matrix.name == 'Future infer strings (without pyarrow)' && '1' || '0' }}
92103
concurrency:
93104
# https://github.community/t/concurrecy-not-work-for-push/183068/7
94-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.extra_apt || '' }}-${{ matrix.pandas_future_infer_string }}
105+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.extra_apt || '' }}-${{ matrix.pandas_future_infer_string }}-${{ matrix.platform }}
95106
cancel-in-progress: true
96107

97108
services:

.github/workflows/wheels.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ jobs:
9494
buildplat:
9595
- [ubuntu-22.04, manylinux_x86_64]
9696
- [ubuntu-22.04, musllinux_x86_64]
97-
- [macos-12, macosx_x86_64]
97+
- [ubuntu-24.04-arm, manylinux_aarch64]
98+
- [macos-13, macosx_x86_64]
9899
# Note: M1 images on Github Actions start from macOS 14
99100
- [macos-14, macosx_arm64]
100101
- [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 & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,18 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
7373
-i "pandas.Period.freq GL08" \
7474
-i "pandas.Period.ordinal GL08" \
75-
-i "pandas.RangeIndex.from_range PR01,SA01" \
7675
-i "pandas.Timedelta.max PR02" \
7776
-i "pandas.Timedelta.min PR02" \
7877
-i "pandas.Timedelta.resolution PR02" \
7978
-i "pandas.Timestamp.max PR02" \
8079
-i "pandas.Timestamp.min PR02" \
8180
-i "pandas.Timestamp.resolution PR02" \
8281
-i "pandas.Timestamp.tzinfo GL08" \
83-
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
84-
-i "pandas.arrays.NumpyExtensionArray SA01" \
8582
-i "pandas.arrays.TimedeltaArray PR07,SA01" \
8683
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
8784
-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" \
9285
-i "pandas.core.resample.Resampler.quantile PR01,PR07" \
93-
-i "pandas.core.resample.Resampler.std SA01" \
9486
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
95-
-i "pandas.core.resample.Resampler.var SA01" \
96-
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
9787
-i "pandas.plotting.andrews_curves RT03,SA01" \
9888
-i "pandas.tseries.offsets.BDay PR02,SA01" \
9989
-i "pandas.tseries.offsets.BQuarterBegin.is_on_offset GL08" \

ci/deps/actions-311-pyarrownightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies:
2323

2424
- pip:
2525
- "tzdata>=2022.7"
26-
- "--extra-index-url https://pypi.fury.io/arrow-nightlies/"
26+
- "--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
2727
- "--prefer-binary"
2828
- "--pre"
2929
- "pyarrow"
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/groupby.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Function application
104104
DataFrameGroupBy.shift
105105
DataFrameGroupBy.size
106106
DataFrameGroupBy.skew
107+
DataFrameGroupBy.kurt
107108
DataFrameGroupBy.std
108109
DataFrameGroupBy.sum
109110
DataFrameGroupBy.var
@@ -159,6 +160,7 @@ Function application
159160
SeriesGroupBy.shift
160161
SeriesGroupBy.size
161162
SeriesGroupBy.skew
163+
SeriesGroupBy.kurt
162164
SeriesGroupBy.std
163165
SeriesGroupBy.sum
164166
SeriesGroupBy.var

doc/source/reference/window.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ Rolling window functions
3030
Rolling.std
3131
Rolling.min
3232
Rolling.max
33+
Rolling.first
34+
Rolling.last
3335
Rolling.corr
3436
Rolling.cov
3537
Rolling.skew
3638
Rolling.kurt
3739
Rolling.apply
40+
Rolling.pipe
3841
Rolling.aggregate
3942
Rolling.quantile
4043
Rolling.sem
@@ -71,11 +74,14 @@ Expanding window functions
7174
Expanding.std
7275
Expanding.min
7376
Expanding.max
77+
Expanding.first
78+
Expanding.last
7479
Expanding.corr
7580
Expanding.cov
7681
Expanding.skew
7782
Expanding.kurt
7883
Expanding.apply
84+
Expanding.pipe
7985
Expanding.aggregate
8086
Expanding.quantile
8187
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: 2 additions & 2 deletions
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:
@@ -105,6 +105,7 @@ Conversion
105105

106106
Strings
107107
^^^^^^^
108+
- Bug in :meth:`Series.__pos__` and :meth:`DataFrame.__pos__` did not raise for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`60710`)
108109
- Bug in :meth:`Series.rank` for :class:`StringDtype` with ``storage="pyarrow"`` incorrectly returning integer results in case of ``method="average"`` and raising an error if it would truncate results (:issue:`59768`)
109110
- Bug in :meth:`Series.replace` with :class:`StringDtype` when replacing with a non-string value was not upcasting to ``object`` dtype (:issue:`60282`)
110111
- Bug in :meth:`Series.str.replace` when ``n < 0`` for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`59628`)
@@ -175,7 +176,6 @@ Other
175176
^^^^^
176177
- Fixed usage of ``inspect`` when the optional dependencies ``pyarrow`` or ``jinja2``
177178
are not installed (:issue:`60196`)
178-
-
179179

180180
.. ---------------------------------------------------------------------------
181181
.. _whatsnew_230.contributors:

0 commit comments

Comments
 (0)