Skip to content

Commit 0890621

Browse files
authored
Merge branch 'main' into main
2 parents 5331158 + 2bb3fef commit 0890621

Some content is hidden

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

67 files changed

+494
-146
lines changed

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/10min.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ Setting a new column automatically aligns the data by the indexes:
318318

319319
.. ipython:: python
320320
321-
s1 = pd.Series([1, 2, 3, 4, 5, 6], index=pd.date_range("20130102", periods=6))
321+
s1 = pd.Series(
322+
[1, 2, 3, 4, 5, 6],
323+
index=pd.date_range("20130102", periods=6))
322324
s1
323325
df["F"] = s1
324326

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 & 0 deletions
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`)
@@ -1002,6 +1004,7 @@ Numeric
10021004
- Bug in :meth:`Series.dot` returning ``object`` dtype for :class:`ArrowDtype` and nullable-dtype data (:issue:`61375`)
10031005
- Bug in :meth:`Series.std` and :meth:`Series.var` when using complex-valued data (:issue:`61645`)
10041006
- Bug in ``np.matmul`` with :class:`Index` inputs raising a ``TypeError`` (:issue:`57079`)
1007+
- Bug in arithmetic operations between objects with numpy-nullable dtype and :class:`ArrowDtype` incorrectly raising (:issue:`58602`)
10051008

10061009
Conversion
10071010
^^^^^^^^^^
@@ -1057,6 +1060,7 @@ MultiIndex
10571060
- :func:`MultiIndex.get_level_values` accessing a :class:`DatetimeIndex` does not carry the frequency attribute along (:issue:`58327`, :issue:`57949`)
10581061
- Bug in :class:`DataFrame` arithmetic operations in case of unaligned MultiIndex columns (:issue:`60498`)
10591062
- Bug in :class:`DataFrame` arithmetic operations with :class:`Series` in case of unaligned MultiIndex (:issue:`61009`)
1063+
- Bug in :meth:`MultiIndex.union` raising when indexes have duplicates with differing names (:issue:`62059`)
10601064
- Bug in :meth:`MultiIndex.from_tuples` causing wrong output with input of type tuples having NaN values (:issue:`60695`, :issue:`60988`)
10611065
- Bug in :meth:`DataFrame.__setitem__` where column alignment logic would reindex the assigned value with an empty index, incorrectly setting all values to ``NaN``.(:issue:`61841`)
10621066
- Bug in :meth:`DataFrame.reindex` and :meth:`Series.reindex` where reindexing :class:`Index` to a :class:`MultiIndex` would incorrectly set all values to ``NaN``.(:issue:`60923`)

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)