Skip to content

Commit 0cf5c89

Browse files
committed
Merge branch 'main' into free-threaded-wheels
2 parents 15d0c8d + 794913c commit 0cf5c89

File tree

149 files changed

+2347
-2195
lines changed

Some content is hidden

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

149 files changed

+2347
-2195
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ jobs:
391391
env:
392392
PYTHON_GIL: 0
393393

394+
# NOTE: this job must be kept in sync with the Pyodide build job in wheels.yml
394395
emscripten:
395396
# Note: the Python version, Emscripten toolchain version are determined
396397
# by the Pyodide version. The appropriate versions can be found in the

.github/workflows/wheels.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,16 @@ jobs:
109109
cibw_build_frontend: 'pip; args: --no-build-isolation'
110110
- python: ["cp313t", "3.13"]
111111
cibw_build_frontend: 'pip; args: --no-build-isolation'
112+
# Build Pyodide wheels and upload them to Anaconda.org
113+
# NOTE: this job is similar to the one in unit-tests.yml except for the fact
114+
# that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup.
115+
- buildplat: [ubuntu-22.04, pyodide_wasm32]
116+
python: ["cp312", "3.12"]
112117
# TODO: Build free-threaded wheels for Windows
113118
exclude:
114119
- buildplat: [windows-2022, win_amd64]
115120
python: ["cp313t", "3.13"]
121+
116122
env:
117123
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
118124
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -153,13 +159,14 @@ jobs:
153159
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
154160

155161
- name: Build wheels
156-
uses: pypa/[email protected].1
162+
uses: pypa/[email protected].2
157163
with:
158164
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
159165
env:
160166
CIBW_PRERELEASE_PYTHONS: True
161167
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
162168
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend }}
169+
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}
163170

164171
- name: Set up Python
165172
uses: mamba-org/setup-micromamba@v1

.pre-commit-config.yaml

Lines changed: 4 additions & 3 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.4.7
22+
rev: v0.5.0
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -67,12 +67,13 @@ repos:
6767
- id: fix-encoding-pragma
6868
args: [--remove]
6969
- id: trailing-whitespace
70+
args: [--markdown-linebreak-ext=md]
7071
- repo: https://github.com/PyCQA/isort
7172
rev: 5.13.2
7273
hooks:
7374
- id: isort
7475
- repo: https://github.com/asottile/pyupgrade
75-
rev: v3.15.2
76+
rev: v3.16.0
7677
hooks:
7778
- id: pyupgrade
7879
args: [--py310-plus]
@@ -92,7 +93,7 @@ repos:
9293
- id: sphinx-lint
9394
args: ["--enable", "all", "--disable", "line-too-long"]
9495
- repo: https://github.com/pre-commit/mirrors-clang-format
95-
rev: v18.1.5
96+
rev: v18.1.8
9697
hooks:
9798
- id: clang-format
9899
files: ^pandas/_libs/src|^pandas/_libs/include

asv_bench/benchmarks/indexing.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -546,24 +546,17 @@ def time_chained_indexing(self, mode):
546546

547547

548548
class Block:
549-
params = [
550-
(True, "True"),
551-
(np.array(True), "np.array(True)"),
552-
]
553-
554-
def setup(self, true_value, mode):
549+
def setup(self):
555550
self.df = DataFrame(
556551
False,
557552
columns=np.arange(500).astype(str),
558553
index=date_range("2010-01-01", "2011-01-01"),
559554
)
560555

561-
self.true_value = true_value
562-
563-
def time_test(self, true_value, mode):
556+
def time_test(self):
564557
start = datetime(2010, 5, 1)
565558
end = datetime(2010, 9, 1)
566-
self.df.loc[start:end, :] = true_value
559+
self.df.loc[start:end, :] = True
567560

568561

569562
from .pandas_vb_common import setup # noqa: F401 isort:skip

ci/code_checks.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7070
--format=actions \
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
73-
-i "pandas.DataFrame.max RT03" \
74-
-i "pandas.DataFrame.mean RT03" \
75-
-i "pandas.DataFrame.median RT03" \
76-
-i "pandas.DataFrame.min RT03" \
7773
-i "pandas.DataFrame.plot PR02" \
7874
-i "pandas.Grouper PR02" \
7975
-i "pandas.MultiIndex.append PR07,SA01" \
@@ -95,7 +91,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9591
-i "pandas.Period.freq GL08" \
9692
-i "pandas.Period.freqstr SA01" \
9793
-i "pandas.Period.month SA01" \
98-
-i "pandas.Period.now SA01" \
9994
-i "pandas.Period.ordinal GL08" \
10095
-i "pandas.Period.strftime PR01,SA01" \
10196
-i "pandas.Period.to_timestamp SA01" \
@@ -167,7 +162,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
167162
-i "pandas.Series.product RT03" \
168163
-i "pandas.Series.reorder_levels RT03,SA01" \
169164
-i "pandas.Series.sem PR01,RT03,SA01" \
170-
-i "pandas.Series.skew RT03,SA01" \
165+
-i "pandas.Series.skew SA01" \
171166
-i "pandas.Series.sparse PR01,SA01" \
172167
-i "pandas.Series.sparse.density SA01" \
173168
-i "pandas.Series.sparse.fill_value SA01" \
@@ -244,13 +239,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
244239
-i "pandas.Timestamp.month_name SA01" \
245240
-i "pandas.Timestamp.nanosecond GL08" \
246241
-i "pandas.Timestamp.normalize SA01" \
247-
-i "pandas.Timestamp.now SA01" \
248242
-i "pandas.Timestamp.quarter SA01" \
249243
-i "pandas.Timestamp.replace PR07,SA01" \
250244
-i "pandas.Timestamp.resolution PR02" \
251245
-i "pandas.Timestamp.second GL08" \
252246
-i "pandas.Timestamp.strptime PR01,SA01" \
253-
-i "pandas.Timestamp.time SA01" \
254247
-i "pandas.Timestamp.timestamp SA01" \
255248
-i "pandas.Timestamp.timetuple SA01" \
256249
-i "pandas.Timestamp.timetz SA01" \
@@ -317,11 +310,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
317310
-i "pandas.api.types.is_period_dtype SA01" \
318311
-i "pandas.api.types.is_re PR07,SA01" \
319312
-i "pandas.api.types.is_re_compilable PR07,SA01" \
320-
-i "pandas.api.types.is_signed_integer_dtype SA01" \
321313
-i "pandas.api.types.is_sparse SA01" \
322314
-i "pandas.api.types.is_string_dtype SA01" \
323315
-i "pandas.api.types.is_timedelta64_ns_dtype SA01" \
324-
-i "pandas.api.types.is_unsigned_integer_dtype SA01" \
325316
-i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \
326317
-i "pandas.api.types.union_categoricals RT03,SA01" \
327318
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \

doc/source/getting_started/intro_tutorials/04_plotting.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ How do I create plots in pandas?
3232
air_quality.head()
3333
3434
.. note::
35-
The usage of the ``index_col`` and ``parse_dates`` parameters of the ``read_csv`` function to define the first (0th) column as
36-
index of the resulting ``DataFrame`` and convert the dates in the column to :class:`Timestamp` objects, respectively.
35+
The ``index_col=0`` and ``parse_dates=True`` parameters passed to the ``read_csv`` function define
36+
the first (0th) column as index of the resulting ``DataFrame`` and convert the dates in the column
37+
to :class:`Timestamp` objects, respectively.
38+
3739

3840
.. raw:: html
3941

doc/source/getting_started/overview.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
Package overview
77
****************
88

9-
pandas is a `Python <https://www.python.org>`__ package providing fast,
9+
pandas is a `Python <https://www.python.org>`__ package that provides fast,
1010
flexible, and expressive data structures designed to make working with
1111
"relational" or "labeled" data both easy and intuitive. It aims to be the
12-
fundamental high-level building block for doing practical, **real-world** data
13-
analysis in Python. Additionally, it has the broader goal of becoming **the
12+
fundamental high-level building block for Python's practical, **real-world** data
13+
analysis. Additionally, it seeks to become **the
1414
most powerful and flexible open source data analysis/manipulation tool
1515
available in any language**. It is already well on its way toward this goal.
1616

doc/source/user_guide/categorical.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ Assigning a ``Categorical`` to parts of a column of other types will use the val
793793
:okwarning:
794794
795795
df = pd.DataFrame({"a": [1, 1, 1, 1, 1], "b": ["a", "a", "a", "a", "a"]})
796-
df.loc[1:2, "a"] = pd.Categorical(["b", "b"], categories=["a", "b"])
796+
df.loc[1:2, "a"] = pd.Categorical([2, 2], categories=[2, 3])
797797
df.loc[2:3, "b"] = pd.Categorical(["b", "b"], categories=["a", "b"])
798798
df
799799
df.dtypes

doc/source/user_guide/io.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,7 @@ a JSON string with two fields, ``schema`` and ``data``.
21612161
{
21622162
"A": [1, 2, 3],
21632163
"B": ["a", "b", "c"],
2164-
"C": pd.date_range("2016-01-01", freq="d", periods=3),
2164+
"C": pd.date_range("2016-01-01", freq="D", periods=3),
21652165
},
21662166
index=pd.Index(range(3), name="idx"),
21672167
)
@@ -2270,7 +2270,7 @@ round-trippable manner.
22702270
{
22712271
"foo": [1, 2, 3, 4],
22722272
"bar": ["a", "b", "c", "d"],
2273-
"baz": pd.date_range("2018-01-01", freq="d", periods=4),
2273+
"baz": pd.date_range("2018-01-01", freq="D", periods=4),
22742274
"qux": pd.Categorical(["a", "b", "c", "c"]),
22752275
},
22762276
index=pd.Index(range(4), name="idx"),

doc/source/whatsnew/v0.18.0.rst

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,28 @@ Tz-aware are rounded, floored and ceiled in local times
322322
323323
Timedeltas
324324

325-
.. ipython:: python
325+
.. code-block:: ipython
326+
327+
In [37]: t = pd.timedelta_range('1 days 2 hr 13 min 45 us', periods=3, freq='d')
326328
327-
t = pd.timedelta_range('1 days 2 hr 13 min 45 us', periods=3, freq='d')
328-
t
329-
t.round('10min')
329+
In [38]: t
330+
Out[38]:
331+
TimedeltaIndex(['1 days 02:13:00.000045', '2 days 02:13:00.000045',
332+
'3 days 02:13:00.000045'],
333+
dtype='timedelta64[ns]', freq='D')
334+
335+
In [39]: t.round('10min')
336+
Out[39]:
337+
TimedeltaIndex(['1 days 02:10:00', '2 days 02:10:00',
338+
'3 days 02:10:00'],
339+
dtype='timedelta64[ns]', freq=None)
330340
331341
# Timedelta scalar
332-
t[0]
333-
t[0].round('2h')
342+
In [40]: t[0]
343+
Out[40]: Timedelta('1 days 02:13:00.000045')
344+
345+
In [41]: t[0].round('2h')
346+
Out[41]: Timedelta('1 days 02:00:00')
334347
335348
336349
In addition, ``.round()``, ``.floor()`` and ``.ceil()`` will be available through the ``.dt`` accessor of ``Series``.

0 commit comments

Comments
 (0)