Skip to content

Commit f90a268

Browse files
committed
Merge main
2 parents 898a9bc + 64e8f2c commit f90a268

File tree

106 files changed

+2876
-413
lines changed

Some content is hidden

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

106 files changed

+2876
-413
lines changed

.github/actions/run-tests/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
if: failure()
1515

1616
- name: Upload coverage to Codecov
17-
uses: codecov/codecov-action@v4
17+
uses: codecov/codecov-action@v5
1818
with:
1919
flags: unittests
2020
name: codecov-pandas

.github/actions/setup-conda/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
using: composite
88
steps:
99
- name: Install ${{ inputs.environment-file }}
10-
uses: mamba-org/setup-micromamba@v1
10+
uses: mamba-org/setup-micromamba@v2
1111
with:
1212
environment-file: ${{ inputs.environment-file }}
1313
environment-name: test

.github/workflows/docbuild-and-upload.yml

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
- name: Build documentation
6060
run: doc/make.py --warnings-are-errors
6161

62+
- name: Build the interactive terminal
63+
working-directory: web/interactive_terminal
64+
run: jupyter lite build
65+
6266
- name: Build documentation zip
6367
run: doc/make.py zip_html
6468

.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/cibuildwheel@v2.22.0
156+
uses: pypa/cibuildwheel@v2.23.1
157157
with:
158158
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
159159
env:

.pre-commit-config.yaml

+2-2
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.9.4
22+
rev: v0.9.9
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -70,7 +70,7 @@ repos:
7070
- id: trailing-whitespace
7171
args: [--markdown-linebreak-ext=md]
7272
- repo: https://github.com/PyCQA/isort
73-
rev: 6.0.0
73+
rev: 6.0.1
7474
hooks:
7575
- id: isort
7676
- repo: https://github.com/asottile/pyupgrade

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"]

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

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" \

doc/source/development/contributing_codebase.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ In some cases you may be tempted to use ``cast`` from the typing module when you
198198
obj = cast(str, obj) # Mypy complains without this!
199199
return obj.upper()
200200
201-
The limitation here is that while a human can reasonably understand that ``is_number`` would catch the ``int`` and ``float`` types mypy cannot make that same inference just yet (see `mypy #5206 <https://github.com/python/mypy/issues/5206>`_. While the above works, the use of ``cast`` is **strongly discouraged**. Where applicable a refactor of the code to appease static analysis is preferable
201+
The limitation here is that while a human can reasonably understand that ``is_number`` would catch the ``int`` and ``float`` types mypy cannot make that same inference just yet (see `mypy #5206 <https://github.com/python/mypy/issues/5206>`_). While the above works, the use of ``cast`` is **strongly discouraged**. Where applicable a refactor of the code to appease static analysis is preferable
202202

203203
.. code-block:: python
204204

doc/source/getting_started/intro_tutorials/03_subset_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ the name ``anonymous`` to the first 3 elements of the fourth column:
335335
.. ipython:: python
336336
337337
titanic.iloc[0:3, 3] = "anonymous"
338-
titanic.head()
338+
titanic.iloc[:5, 3]
339339
340340
.. raw:: html
341341

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

doc/source/reference/arrays.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ is an :class:`ArrowDtype`.
6161
support as NumPy including first-class nullability support for all data types, immutability and more.
6262

6363
The table below shows the equivalent pyarrow-backed (``pa``), pandas extension, and numpy (``np``) types that are recognized by pandas.
64-
Pyarrow-backed types below need to be passed into :class:`ArrowDtype` to be recognized by pandas e.g. ``pd.ArrowDtype(pa.bool_())``
64+
Pyarrow-backed types below need to be passed into :class:`ArrowDtype` to be recognized by pandas e.g. ``pd.ArrowDtype(pa.bool_())``.
6565

6666
=============================================== ========================== ===================
6767
PyArrow type pandas extension type NumPy type
@@ -114,7 +114,7 @@ values.
114114

115115
ArrowDtype
116116

117-
For more information, please see the :ref:`PyArrow user guide <pyarrow>`
117+
For more information, please see the :ref:`PyArrow user guide <pyarrow>`.
118118

119119
.. _api.arrays.datetime:
120120

@@ -495,7 +495,7 @@ a :class:`CategoricalDtype`.
495495
CategoricalDtype.categories
496496
CategoricalDtype.ordered
497497

498-
Categorical data can be stored in a :class:`pandas.Categorical`
498+
Categorical data can be stored in a :class:`pandas.Categorical`:
499499

500500
.. autosummary::
501501
:toctree: api/

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::

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

doc/source/user_guide/io.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like
1818
:widths: 30, 100, 60, 60
1919

2020
text,`CSV <https://en.wikipedia.org/wiki/Comma-separated_values>`__, :ref:`read_csv<io.read_csv_table>`, :ref:`to_csv<io.store_in_csv>`
21-
text,Fixed-Width Text File, :ref:`read_fwf<io.fwf_reader>` , NA
21+
text,Fixed-Width Text File, :ref:`read_fwf<io.fwf_reader>`, NA
2222
text,`JSON <https://www.json.org/>`__, :ref:`read_json<io.json_reader>`, :ref:`to_json<io.json_writer>`
2323
text,`HTML <https://en.wikipedia.org/wiki/HTML>`__, :ref:`read_html<io.read_html>`, :ref:`to_html<io.html>`
24-
text,`LaTeX <https://en.wikipedia.org/wiki/LaTeX>`__, :ref:`Styler.to_latex<io.latex>` , NA
24+
text,`LaTeX <https://en.wikipedia.org/wiki/LaTeX>`__, NA, :ref:`Styler.to_latex<io.latex>`
2525
text,`XML <https://www.w3.org/standards/xml/core>`__, :ref:`read_xml<io.read_xml>`, :ref:`to_xml<io.xml>`
2626
text, Local clipboard, :ref:`read_clipboard<io.clipboard>`, :ref:`to_clipboard<io.clipboard>`
2727
binary,`MS Excel <https://en.wikipedia.org/wiki/Microsoft_Excel>`__ , :ref:`read_excel<io.excel_reader>`, :ref:`to_excel<io.excel_writer>`

0 commit comments

Comments
 (0)