Skip to content

Commit 9c1dd1c

Browse files
Merge branch 'main' into bug_final_branch
2 parents 4bb422d + 4c5f4ca commit 9c1dd1c

File tree

97 files changed

+1641
-475
lines changed

Some content is hidden

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

97 files changed

+1641
-475
lines changed

Diff for: .github/CODEOWNERS

-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ doc/source/development @noatamir
1010

1111
# pandas
1212
pandas/_libs/ @WillAyd
13-
pandas/_libs/tslibs/* @MarcoGorelli
1413
pandas/_typing.py @Dr-Irv
1514
pandas/core/groupby/* @rhshadrach
16-
pandas/core/tools/datetimes.py @MarcoGorelli
1715
pandas/io/excel/* @rhshadrach
1816
pandas/io/formats/style.py @attack68
1917
pandas/io/formats/style_render.py @attack68

Diff for: .github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
154154

155155
- name: Build wheels
156-
uses: pypa/[email protected].0
156+
uses: pypa/[email protected].2
157157
with:
158158
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
159159
env:

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ COPY requirements-dev.txt /tmp
1313
RUN python -m pip install -r /tmp/requirements-dev.txt
1414
RUN git config --global --add safe.directory /home/pandas
1515

16-
ENV SHELL "/bin/bash"
16+
ENV SHELL="/bin/bash"
1717
CMD ["/bin/bash"]

Diff for: asv_bench/benchmarks/rolling.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@ class Methods:
1010
["DataFrame", "Series"],
1111
[("rolling", {"window": 10}), ("rolling", {"window": 1000}), ("expanding", {})],
1212
["int", "float"],
13-
["median", "mean", "max", "min", "std", "count", "skew", "kurt", "sum", "sem"],
13+
[
14+
"median",
15+
"mean",
16+
"max",
17+
"min",
18+
"std",
19+
"count",
20+
"skew",
21+
"kurt",
22+
"sum",
23+
"sem",
24+
"nunique",
25+
],
1426
)
1527
param_names = ["constructor", "window_kwargs", "dtype", "method"]
1628

Diff for: ci/code_checks.sh

+20-4
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,23 @@ 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.Timedelta.max PR02" \
76-
-i "pandas.Timedelta.min PR02" \
77-
-i "pandas.Timedelta.resolution PR02" \
7875
-i "pandas.Timestamp.max PR02" \
7976
-i "pandas.Timestamp.min PR02" \
8077
-i "pandas.Timestamp.resolution PR02" \
81-
-i "pandas.Timestamp.tzinfo GL08" \
8278
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
8379
-i "pandas.core.groupby.SeriesGroupBy.plot PR02" \
8480
-i "pandas.core.resample.Resampler.quantile PR01,PR07" \
8581
-i "pandas.tseries.offsets.BDay PR02,SA01" \
82+
-i "pandas.tseries.offsets.BHalfYearBegin.is_on_offset GL08" \
83+
-i "pandas.tseries.offsets.BHalfYearBegin.n GL08" \
84+
-i "pandas.tseries.offsets.BHalfYearBegin.normalize GL08" \
85+
-i "pandas.tseries.offsets.BHalfYearBegin.rule_code GL08" \
86+
-i "pandas.tseries.offsets.BHalfYearBegin.startingMonth GL08" \
87+
-i "pandas.tseries.offsets.BHalfYearEnd.is_on_offset GL08" \
88+
-i "pandas.tseries.offsets.BHalfYearEnd.n GL08" \
89+
-i "pandas.tseries.offsets.BHalfYearEnd.normalize GL08" \
90+
-i "pandas.tseries.offsets.BHalfYearEnd.rule_code GL08" \
91+
-i "pandas.tseries.offsets.BHalfYearEnd.startingMonth GL08" \
8692
-i "pandas.tseries.offsets.BQuarterBegin.is_on_offset GL08" \
8793
-i "pandas.tseries.offsets.BQuarterBegin.n GL08" \
8894
-i "pandas.tseries.offsets.BQuarterBegin.normalize GL08" \
@@ -185,6 +191,16 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
185191
-i "pandas.tseries.offsets.FY5253Quarter.variation GL08" \
186192
-i "pandas.tseries.offsets.FY5253Quarter.weekday GL08" \
187193
-i "pandas.tseries.offsets.FY5253Quarter.year_has_extra_week GL08" \
194+
-i "pandas.tseries.offsets.HalfYearBegin.is_on_offset GL08" \
195+
-i "pandas.tseries.offsets.HalfYearBegin.n GL08" \
196+
-i "pandas.tseries.offsets.HalfYearBegin.normalize GL08" \
197+
-i "pandas.tseries.offsets.HalfYearBegin.rule_code GL08" \
198+
-i "pandas.tseries.offsets.HalfYearBegin.startingMonth GL08" \
199+
-i "pandas.tseries.offsets.HalfYearEnd.is_on_offset GL08" \
200+
-i "pandas.tseries.offsets.HalfYearEnd.n GL08" \
201+
-i "pandas.tseries.offsets.HalfYearEnd.normalize GL08" \
202+
-i "pandas.tseries.offsets.HalfYearEnd.rule_code GL08" \
203+
-i "pandas.tseries.offsets.HalfYearEnd.startingMonth GL08" \
188204
-i "pandas.tseries.offsets.Hour.is_on_offset GL08" \
189205
-i "pandas.tseries.offsets.Hour.n GL08" \
190206
-i "pandas.tseries.offsets.Hour.normalize GL08" \

Diff for: ci/meta.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,3 @@ extra:
8989
- datapythonista
9090
- phofl
9191
- lithomas1
92-
- marcogorelli

Diff for: doc/source/development/contributing_codebase.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ Preferred ``pytest`` idioms
537537
test and does not check if the test will fail. If this is the behavior you desire, use ``pytest.skip`` instead.
538538

539539
If a test is known to fail but the manner in which it fails
540-
is not meant to be captured, use ``pytest.mark.xfail`` It is common to use this method for a test that
540+
is not meant to be captured, use ``pytest.mark.xfail``. It is common to use this method for a test that
541541
exhibits buggy behavior or a non-implemented feature. If
542542
the failing test has flaky behavior, use the argument ``strict=False``. This
543543
will make it so pytest does not fail if the test happens to pass. Using ``strict=False`` is highly undesirable, please use it only as a last resort.

Diff for: doc/source/development/debugging_extensions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ By default building pandas from source will generate a release build. To generat
2323

2424
.. note::
2525

26-
conda environments update CFLAGS/CPPFLAGS with flags that are geared towards generating releases. If using conda, you may need to set ``CFLAGS="$CFLAGS -O0"`` and ``CPPFLAGS="$CPPFLAGS -O0"`` to ensure optimizations are turned off for debugging
26+
conda environments update CFLAGS/CPPFLAGS with flags that are geared towards generating releases, and may work counter towards usage in a development environment. If using conda, you should unset these environment variables via ``export CFLAGS=`` and ``export CPPFLAGS=``
2727

2828
By specifying ``builddir="debug"`` all of the targets will be built and placed in the debug directory relative to the project root. This helps to keep your debug and release artifacts separate; you are of course able to choose a different directory name or omit altogether if you do not care to separate build types.
2929

Diff for: doc/source/getting_started/overview.rst

+1
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,4 @@ License
174174
-------
175175

176176
.. literalinclude:: ../../../LICENSE
177+
:language: none

Diff for: doc/source/reference/offset_frequency.rst

+140
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,146 @@ Methods
776776
QuarterBegin.is_year_start
777777
QuarterBegin.is_year_end
778778

779+
BHalfYearEnd
780+
------------
781+
.. autosummary::
782+
:toctree: api/
783+
784+
BHalfYearEnd
785+
786+
Properties
787+
~~~~~~~~~~
788+
.. autosummary::
789+
:toctree: api/
790+
791+
BHalfYearEnd.freqstr
792+
BHalfYearEnd.kwds
793+
BHalfYearEnd.name
794+
BHalfYearEnd.nanos
795+
BHalfYearEnd.normalize
796+
BHalfYearEnd.rule_code
797+
BHalfYearEnd.n
798+
BHalfYearEnd.startingMonth
799+
800+
Methods
801+
~~~~~~~
802+
.. autosummary::
803+
:toctree: api/
804+
805+
BHalfYearEnd.copy
806+
BHalfYearEnd.is_on_offset
807+
BHalfYearEnd.is_month_start
808+
BHalfYearEnd.is_month_end
809+
BHalfYearEnd.is_quarter_start
810+
BHalfYearEnd.is_quarter_end
811+
BHalfYearEnd.is_year_start
812+
BHalfYearEnd.is_year_end
813+
814+
BHalfYearBegin
815+
--------------
816+
.. autosummary::
817+
:toctree: api/
818+
819+
BHalfYearBegin
820+
821+
Properties
822+
~~~~~~~~~~
823+
.. autosummary::
824+
:toctree: api/
825+
826+
BHalfYearBegin.freqstr
827+
BHalfYearBegin.kwds
828+
BHalfYearBegin.name
829+
BHalfYearBegin.nanos
830+
BHalfYearBegin.normalize
831+
BHalfYearBegin.rule_code
832+
BHalfYearBegin.n
833+
BHalfYearBegin.startingMonth
834+
835+
Methods
836+
~~~~~~~
837+
.. autosummary::
838+
:toctree: api/
839+
840+
BHalfYearBegin.copy
841+
BHalfYearBegin.is_on_offset
842+
BHalfYearBegin.is_month_start
843+
BHalfYearBegin.is_month_end
844+
BHalfYearBegin.is_quarter_start
845+
BHalfYearBegin.is_quarter_end
846+
BHalfYearBegin.is_year_start
847+
BHalfYearBegin.is_year_end
848+
849+
HalfYearEnd
850+
-----------
851+
.. autosummary::
852+
:toctree: api/
853+
854+
HalfYearEnd
855+
856+
Properties
857+
~~~~~~~~~~
858+
.. autosummary::
859+
:toctree: api/
860+
861+
HalfYearEnd.freqstr
862+
HalfYearEnd.kwds
863+
HalfYearEnd.name
864+
HalfYearEnd.nanos
865+
HalfYearEnd.normalize
866+
HalfYearEnd.rule_code
867+
HalfYearEnd.n
868+
HalfYearEnd.startingMonth
869+
870+
Methods
871+
~~~~~~~
872+
.. autosummary::
873+
:toctree: api/
874+
875+
HalfYearEnd.copy
876+
HalfYearEnd.is_on_offset
877+
HalfYearEnd.is_month_start
878+
HalfYearEnd.is_month_end
879+
HalfYearEnd.is_quarter_start
880+
HalfYearEnd.is_quarter_end
881+
HalfYearEnd.is_year_start
882+
HalfYearEnd.is_year_end
883+
884+
HalfYearBegin
885+
-------------
886+
.. autosummary::
887+
:toctree: api/
888+
889+
HalfYearBegin
890+
891+
Properties
892+
~~~~~~~~~~
893+
.. autosummary::
894+
:toctree: api/
895+
896+
HalfYearBegin.freqstr
897+
HalfYearBegin.kwds
898+
HalfYearBegin.name
899+
HalfYearBegin.nanos
900+
HalfYearBegin.normalize
901+
HalfYearBegin.rule_code
902+
HalfYearBegin.n
903+
HalfYearBegin.startingMonth
904+
905+
Methods
906+
~~~~~~~
907+
.. autosummary::
908+
:toctree: api/
909+
910+
HalfYearBegin.copy
911+
HalfYearBegin.is_on_offset
912+
HalfYearBegin.is_month_start
913+
HalfYearBegin.is_month_end
914+
HalfYearBegin.is_quarter_start
915+
HalfYearBegin.is_quarter_end
916+
HalfYearBegin.is_year_start
917+
HalfYearBegin.is_year_end
918+
779919
BYearEnd
780920
--------
781921
.. autosummary::

Diff for: doc/source/reference/window.rst

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Rolling window functions
4242
Rolling.quantile
4343
Rolling.sem
4444
Rolling.rank
45+
Rolling.nunique
4546

4647
.. _api.functions_window:
4748

@@ -86,6 +87,7 @@ Expanding window functions
8687
Expanding.quantile
8788
Expanding.sem
8889
Expanding.rank
90+
Expanding.nunique
8991

9092
.. _api.functions_ewm:
9193

Diff for: doc/source/user_guide/basics.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ of elements to display is five, but you may pass a custom number.
3636
Attributes and underlying data
3737
------------------------------
3838

39-
pandas objects have a number of attributes enabling you to access the metadata
39+
pandas objects have a number of attributes enabling you to access the metadata.
4040

4141
* **shape**: gives the axis dimensions of the object, consistent with ndarray
4242
* Axis labels
@@ -59,7 +59,7 @@ NumPy's type system to add support for custom arrays
5959
(see :ref:`basics.dtypes`).
6060

6161
To get the actual data inside a :class:`Index` or :class:`Series`, use
62-
the ``.array`` property
62+
the ``.array`` property.
6363

6464
.. ipython:: python
6565
@@ -88,18 +88,18 @@ NumPy doesn't have a dtype to represent timezone-aware datetimes, so there
8888
are two possibly useful representations:
8989

9090
1. An object-dtype :class:`numpy.ndarray` with :class:`Timestamp` objects, each
91-
with the correct ``tz``
91+
with the correct ``tz``.
9292
2. A ``datetime64[ns]`` -dtype :class:`numpy.ndarray`, where the values have
93-
been converted to UTC and the timezone discarded
93+
been converted to UTC and the timezone discarded.
9494

95-
Timezones may be preserved with ``dtype=object``
95+
Timezones may be preserved with ``dtype=object``:
9696

9797
.. ipython:: python
9898
9999
ser = pd.Series(pd.date_range("2000", periods=2, tz="CET"))
100100
ser.to_numpy(dtype=object)
101101
102-
Or thrown away with ``dtype='datetime64[ns]'``
102+
Or thrown away with ``dtype='datetime64[ns]'``:
103103

104104
.. ipython:: python
105105

Diff for: doc/source/user_guide/timeseries.rst

+4
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,10 @@ into ``freq`` keyword arguments. The available date offsets and associated frequ
891891
:class:`~pandas.tseries.offsets.BQuarterEnd`, ``'BQE``, "business quarter end"
892892
:class:`~pandas.tseries.offsets.BQuarterBegin`, ``'BQS'``, "business quarter begin"
893893
:class:`~pandas.tseries.offsets.FY5253Quarter`, ``'REQ'``, "retail (aka 52-53 week) quarter"
894+
:class:`~pandas.tseries.offsets.HalfYearEnd`, ``'HYE'``, "calendar half year end"
895+
:class:`~pandas.tseries.offsets.HalfYearBegin`, ``'HYS'``, "calendar half year begin"
896+
:class:`~pandas.tseries.offsets.BHalfYearEnd`, ``'BHYE``, "business half year end"
897+
:class:`~pandas.tseries.offsets.BHalfYearBegin`, ``'BHYS'``, "business half year begin"
894898
:class:`~pandas.tseries.offsets.YearEnd`, ``'YE'``, "calendar year end"
895899
:class:`~pandas.tseries.offsets.YearBegin`, ``'YS'`` or ``'BYS'``,"calendar year begin"
896900
:class:`~pandas.tseries.offsets.BYearEnd`, ``'BYE'``, "business year end"

Diff for: doc/source/whatsnew/v2.3.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Other enhancements
3737
updated to work correctly with NumPy >= 2 (:issue:`57739`)
3838
- :meth:`Series.str.decode` result now has ``StringDtype`` when ``future.infer_string`` is True (:issue:`60709`)
3939
- :meth:`~Series.to_hdf` and :meth:`~DataFrame.to_hdf` now round-trip with ``StringDtype`` (:issue:`60663`)
40+
- Improved ``repr`` of :class:`.NumpyExtensionArray` to account for NEP51 (:issue:`61085`)
4041
- The :meth:`Series.str.decode` has gained the argument ``dtype`` to control the dtype of the result (:issue:`60940`)
4142
- The :meth:`~Series.cumsum`, :meth:`~Series.cummin`, and :meth:`~Series.cummax` reductions are now implemented for ``StringDtype`` columns (:issue:`60633`)
4243
- The :meth:`~Series.sum` reduction is now implemented for ``StringDtype`` columns (:issue:`59853`)
@@ -118,6 +119,7 @@ Conversion
118119

119120
Strings
120121
^^^^^^^
122+
- Bug in :meth:`DataFrame.sum` with ``axis=1``, :meth:`.DataFrameGroupBy.sum` or :meth:`.SeriesGroupBy.sum` with ``skipna=True``, and :meth:`.Resampler.sum` on :class:`StringDtype` with all NA values resulted in ``0`` and is now the empty string ``""`` (:issue:`60229`)
121123
- Bug in :meth:`Series.__pos__` and :meth:`DataFrame.__pos__` did not raise for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`60710`)
122124
- 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`)
123125
- Bug in :meth:`Series.replace` with :class:`StringDtype` when replacing with a non-string value was not upcasting to ``object`` dtype (:issue:`60282`)

0 commit comments

Comments
 (0)