Skip to content

Commit 76750cc

Browse files
Merge branch 'main' into fix/59698-final-v6
2 parents b2950a1 + d81171b commit 76750cc

File tree

89 files changed

+823
-652
lines changed

Some content is hidden

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

89 files changed

+823
-652
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ jobs:
399399
pyodide build
400400
401401
- name: Set up Node.js
402-
uses: actions/setup-node@v5
402+
uses: actions/setup-node@v6
403403
with:
404404
node-version: '20'
405405

ci/code_checks.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7373
-i "pandas.Period.freq GL08" \
7474
-i "pandas.Period.ordinal GL08" \
7575
-i "pandas.errors.IncompatibleFrequency SA01,SS06,EX01" \
76+
-i "pandas.errors.InvalidVersion GL08" \
7677
-i "pandas.api.extensions.ExtensionArray.value_counts EX01,RT03,SA01" \
77-
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
78-
-i "pandas.core.groupby.SeriesGroupBy.plot PR02" \
79-
-i "pandas.core.resample.Resampler.quantile PR01,PR07" \
78+
-i "pandas.api.typing.DataFrameGroupBy.plot PR02" \
79+
-i "pandas.api.typing.SeriesGroupBy.plot PR02" \
80+
-i "pandas.api.typing.Resampler.quantile PR01,PR07" \
81+
-i "pandas.arrays.NumpyExtensionArray GL08" \
8082
-i "pandas.tseries.offsets.BDay PR02,SA01" \
8183
-i "pandas.tseries.offsets.BHalfYearBegin.is_on_offset GL08" \
8284
-i "pandas.tseries.offsets.BHalfYearBegin.n GL08" \

doc/source/reference/groupby.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
=======
66
GroupBy
77
=======
8-
.. currentmodule:: pandas.core.groupby
8+
.. currentmodule:: pandas.api.typing
99

1010
:class:`pandas.api.typing.DataFrameGroupBy` and :class:`pandas.api.typing.SeriesGroupBy`
1111
instances are returned by groupby calls :func:`pandas.DataFrame.groupby` and
@@ -40,7 +40,7 @@ Function application helper
4040

4141
NamedAgg
4242

43-
.. currentmodule:: pandas.core.groupby
43+
.. currentmodule:: pandas.api.typing
4444

4545
Function application
4646
--------------------

doc/source/reference/resampling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
==========
66
Resampling
77
==========
8-
.. currentmodule:: pandas.core.resample
8+
.. currentmodule:: pandas.api.typing
99

1010
:class:`pandas.api.typing.Resampler` instances are returned by
1111
resample calls: :func:`pandas.DataFrame.resample`, :func:`pandas.Series.resample`.

doc/source/reference/window.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ calls: :func:`pandas.DataFrame.ewm` and :func:`pandas.Series.ewm`.
1717

1818
Rolling window functions
1919
------------------------
20-
.. currentmodule:: pandas.core.window.rolling
20+
.. currentmodule:: pandas.api.typing
2121

2222
.. autosummary::
2323
:toctree: api/
@@ -48,7 +48,8 @@ Rolling window functions
4848

4949
Weighted window functions
5050
-------------------------
51-
.. currentmodule:: pandas.core.window.rolling
51+
.. currentmodule:: pandas.api.typing
52+
5253

5354
.. autosummary::
5455
:toctree: api/
@@ -62,7 +63,8 @@ Weighted window functions
6263

6364
Expanding window functions
6465
--------------------------
65-
.. currentmodule:: pandas.core.window.expanding
66+
.. currentmodule:: pandas.api.typing
67+
6668

6769
.. autosummary::
6870
:toctree: api/
@@ -93,7 +95,8 @@ Expanding window functions
9395

9496
Exponentially-weighted window functions
9597
---------------------------------------
96-
.. currentmodule:: pandas.core.window.ewm
98+
.. currentmodule:: pandas.api.typing
99+
97100

98101
.. autosummary::
99102
:toctree: api/

doc/source/user_guide/basics.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,11 +2372,18 @@ integers:
23722372
23732373
df.select_dtypes(include=["number", "bool"], exclude=["unsignedinteger"])
23742374
2375-
To select string columns you must use the ``object`` dtype:
2375+
To select string columns include ``str``:
23762376

23772377
.. ipython:: python
23782378
2379-
df.select_dtypes(include=["object"])
2379+
df.select_dtypes(include=[str])
2380+
2381+
.. note::
2382+
2383+
This is a change in pandas 3.0. Previously strings were stored in ``object``
2384+
dtype columns, so would be selected with ``include=[object]``. See
2385+
:ref:`the migration guide <string_migration.select_dtypes>` for details on
2386+
how to write code that works with both versions.
23802387

23812388
To see all the child dtypes of a generic ``dtype`` like ``numpy.number`` you
23822389
can define a function that returns a tree of child dtypes:

doc/source/user_guide/enhancingperf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ by evaluate arithmetic and boolean expression all at once for large :class:`~pan
455455
:func:`~pandas.eval` is many orders of magnitude slower for
456456
smaller expressions or objects than plain Python. A good rule of thumb is
457457
to only use :func:`~pandas.eval` when you have a
458-
:class:`~pandas.core.frame.DataFrame` with more than 10,000 rows.
458+
:class:`~pandas.DataFrame` with more than 10,000 rows.
459459

460460
Supported syntax
461461
~~~~~~~~~~~~~~~~

doc/source/user_guide/migration-3-strings.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ This is actually compatible with pandas 2.x as well, since in pandas < 3,
195195
of also stringifying missing values in pandas 2.x. See the section
196196
:ref:`string_migration_guide-astype_str` for more details.
197197

198+
.. _string_migration.select_dtypes:
199+
198200
For selecting string columns with :meth:`~DataFrame.select_dtypes` in a pandas
199201
2.x and 3.x compatible way, it is not possible to use ``"str"``. While this
200202
works for pandas 3.x, it raises an error in pandas 2.x.

doc/source/whatsnew/v3.0.0.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ Other Deprecations
717717
- Deprecated using ``epoch`` date format in :meth:`DataFrame.to_json` and :meth:`Series.to_json`, use ``iso`` instead. (:issue:`57063`)
718718
- Deprecated allowing ``fill_value`` that cannot be held in the original dtype (excepting NA values for integer and bool dtypes) in :meth:`Series.unstack` and :meth:`DataFrame.unstack` (:issue:`12189`, :issue:`53868`)
719719
- Deprecated allowing ``fill_value`` that cannot be held in the original dtype (excepting NA values for integer and bool dtypes) in :meth:`Series.shift` and :meth:`DataFrame.shift` (:issue:`53802`)
720+
- Deprecated backward-compatibility behavior for :meth:`DataFrame.select_dtypes` matching "str" dtype when ``np.object_`` is specified (:issue:`61916`)
720721
- Deprecated option "future.no_silent_downcasting", as it is no longer used. In a future version accessing this option will raise (:issue:`59502`)
721722
- Deprecated slicing on a :class:`Series` or :class:`DataFrame` with a :class:`DatetimeIndex` using a ``datetime.date`` object, explicitly cast to :class:`Timestamp` instead (:issue:`35830`)
722723

@@ -797,6 +798,7 @@ Other Removals
797798
- Enforce deprecation in :func:`testing.assert_series_equal` and :func:`testing.assert_frame_equal` with object dtype and mismatched null-like values, which are now considered not-equal (:issue:`18463`)
798799
- Enforce banning of upcasting in in-place setitem-like operations (:issue:`59007`) (see `PDEP6 <https://pandas.pydata.org/pdeps/0006-ban-upcasting.html>`_)
799800
- Enforced deprecation ``all`` and ``any`` reductions with ``datetime64``, :class:`DatetimeTZDtype`, and :class:`PeriodDtype` dtypes (:issue:`58029`)
801+
- Enforced deprecation allowing non-``bool`` and NA values for ``na`` in :meth:`.str.contains`, :meth:`.str.startswith`, and :meth:`.str.endswith` (:issue:`59615`)
800802
- Enforced deprecation disallowing ``float`` "periods" in :func:`date_range`, :func:`period_range`, :func:`timedelta_range`, :func:`interval_range`, (:issue:`56036`)
801803
- Enforced deprecation disallowing parsing datetimes with mixed time zones unless user passes ``utc=True`` to :func:`to_datetime` (:issue:`57275`)
802804
- Enforced deprecation in :meth:`Series.value_counts` and :meth:`Index.value_counts` with object dtype performing dtype inference on the ``.index`` of the result (:issue:`56161`)
@@ -1039,6 +1041,7 @@ Indexing
10391041
- Bug in reindexing of :class:`DataFrame` with :class:`PeriodDtype` columns in case of consolidated block (:issue:`60980`, :issue:`60273`)
10401042
- Bug in :meth:`DataFrame.loc.__getitem__` and :meth:`DataFrame.iloc.__getitem__` with a :class:`CategoricalDtype` column with integer categories raising when trying to index a row containing a ``NaN`` entry (:issue:`58954`)
10411043
- Bug in :meth:`Index.__getitem__` incorrectly raising with a 0-dim ``np.ndarray`` key (:issue:`55601`)
1044+
- Bug in :meth:`Index.get_indexer` not casting missing values correctly for new string datatype (:issue:`55833`)
10421045
- Bug in adding new rows with :meth:`DataFrame.loc.__setitem__` or :class:`Series.loc.__setitem__` which failed to retain dtype on the object's index in some cases (:issue:`41626`)
10431046
- Bug in indexing on a :class:`DatetimeIndex` with a ``timestamp[pyarrow]`` dtype or on a :class:`TimedeltaIndex` with a ``duration[pyarrow]`` dtype (:issue:`62277`)
10441047

@@ -1084,6 +1087,7 @@ I/O
10841087
- Bug in :meth:`HDFStore.select` causing queries on categorical string columns to return unexpected results (:issue:`57608`)
10851088
- Bug in :meth:`MultiIndex.factorize` incorrectly raising on length-0 indexes (:issue:`57517`)
10861089
- Bug in :meth:`read_csv` causing segmentation fault when ``encoding_errors`` is not a string. (:issue:`59059`)
1090+
- Bug in :meth:`read_csv` for the ``c`` and ``python`` engines where parsing numbers with large exponents caused overflows. Now, numbers with large positive exponents are parsed as ``inf`` or ``-inf`` depending on the sign of the mantissa, while those with large negative exponents are parsed as ``0.0`` (:issue:`62617`, :issue:`38794`, :issue:`62740`)
10871091
- Bug in :meth:`read_csv` raising ``TypeError`` when ``index_col`` is specified and ``na_values`` is a dict containing the key ``None``. (:issue:`57547`)
10881092
- Bug in :meth:`read_csv` raising ``TypeError`` when ``nrows`` and ``iterator`` are specified without specifying a ``chunksize``. (:issue:`59079`)
10891093
- Bug in :meth:`read_csv` where the order of the ``na_values`` makes an inconsistency when ``na_values`` is a list non-string values. (:issue:`59303`)
@@ -1145,7 +1149,6 @@ Groupby/resample/rolling
11451149
- Bug in :meth:`Rolling.apply` for ``method="table"`` where column order was not being respected due to the columns getting sorted by default. (:issue:`59666`)
11461150
- Bug in :meth:`Rolling.apply` where the applied function could be called on fewer than ``min_period`` periods if ``method="table"``. (:issue:`58868`)
11471151
- Bug in :meth:`Series.resample` could raise when the date range ended shortly before a non-existent time. (:issue:`58380`)
1148-
- Bug in :meth:`Series.rolling.var` and :meth:`Series.rolling.std` where the end of window was not indexed correctly. (:issue:`47721`, :issue:`52407`, :issue:`54518`, :issue:`55343`)
11491152

11501153
Reshaping
11511154
^^^^^^^^^

meson.build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ versioneer = files('generate_version.py')
1818

1919
add_project_arguments('-DNPY_NO_DEPRECATED_API=0', language: 'c')
2020
add_project_arguments('-DNPY_NO_DEPRECATED_API=0', language: 'cpp')
21+
# Enables settings __module__ on cdef classes
22+
# https://github.com/cython/cython/issues/7231
23+
add_project_arguments('-DCYTHON_USE_TYPE_SPECS=1', language: 'c')
2124

2225
# Allow supporting older numpys than the version compiled against
2326
# Set the define to the min supported version of numpy for pandas

0 commit comments

Comments
 (0)