Skip to content

Commit e041e8c

Browse files
Merge branch 'pandas-dev:main' into reflect-changes-in-components
2 parents 9a8cb81 + 96ad671 commit e041e8c

File tree

9 files changed

+34
-47
lines changed

9 files changed

+34
-47
lines changed

.circleci/config.yml

-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ jobs:
7272
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
7373
command: |
7474
pip3 install cibuildwheel==2.15.0
75-
# When this is a nightly wheel build, allow picking up NumPy 2.0 dev wheels:
76-
if [[ "$IS_SCHEDULE_DISPATCH" == "true" || "$IS_PUSH" != 'true' ]]; then
77-
export CIBW_ENVIRONMENT="PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
78-
fi
7975
cibuildwheel --prerelease-pythons --output-dir wheelhouse
8076
8177
environment:

.github/workflows/wheels.yml

-12
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,6 @@ jobs:
148148
CIBW_PRERELEASE_PYTHONS: True
149149
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
150150

151-
- name: Build nightly wheels (with NumPy pre-release)
152-
if: ${{ (env.IS_SCHEDULE_DISPATCH == 'true' && env.IS_PUSH != 'true') }}
153-
uses: pypa/[email protected]
154-
with:
155-
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
156-
env:
157-
# The nightly wheels should be build witht he NumPy 2.0 pre-releases
158-
# which requires the additional URL.
159-
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
160-
CIBW_PRERELEASE_PYTHONS: True
161-
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
162-
163151
- name: Set up Python
164152
uses: mamba-org/setup-micromamba@v1
165153
with:

ci/code_checks.sh

-10
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8484
-i "pandas.DataFrame.assign SA01" \
8585
-i "pandas.DataFrame.at_time PR01" \
8686
-i "pandas.DataFrame.axes SA01" \
87-
-i "pandas.DataFrame.backfill PR01,SA01" \
8887
-i "pandas.DataFrame.bfill SA01" \
8988
-i "pandas.DataFrame.columns SA01" \
9089
-i "pandas.DataFrame.copy SA01" \
@@ -104,7 +103,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
104103
-i "pandas.DataFrame.mean RT03,SA01" \
105104
-i "pandas.DataFrame.median RT03,SA01" \
106105
-i "pandas.DataFrame.min RT03" \
107-
-i "pandas.DataFrame.pad PR01,SA01" \
108106
-i "pandas.DataFrame.plot PR02,SA01" \
109107
-i "pandas.DataFrame.pop SA01" \
110108
-i "pandas.DataFrame.prod RT03" \
@@ -119,17 +117,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
119117
-i "pandas.DataFrame.sparse.to_dense SA01" \
120118
-i "pandas.DataFrame.std PR01,RT03,SA01" \
121119
-i "pandas.DataFrame.sum RT03" \
122-
-i "pandas.DataFrame.swapaxes PR01,SA01" \
123120
-i "pandas.DataFrame.swaplevel SA01" \
124121
-i "pandas.DataFrame.to_feather SA01" \
125122
-i "pandas.DataFrame.to_markdown SA01" \
126123
-i "pandas.DataFrame.to_parquet RT03" \
127124
-i "pandas.DataFrame.to_period SA01" \
128125
-i "pandas.DataFrame.to_timestamp SA01" \
129126
-i "pandas.DataFrame.tz_convert SA01" \
130-
-i "pandas.DataFrame.tz_localize SA01" \
131-
-i "pandas.DataFrame.unstack RT03" \
132-
-i "pandas.DataFrame.value_counts RT03" \
133127
-i "pandas.DataFrame.var PR01,RT03,SA01" \
134128
-i "pandas.DataFrame.where RT03" \
135129
-i "pandas.DatetimeIndex.ceil SA01" \
@@ -226,7 +220,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
226220
-i "pandas.Index.to_list RT03" \
227221
-i "pandas.Index.union PR07,RT03,SA01" \
228222
-i "pandas.Index.unique RT03" \
229-
-i "pandas.Index.value_counts RT03" \
230223
-i "pandas.Index.view GL08" \
231224
-i "pandas.Int16Dtype SA01" \
232225
-i "pandas.Int32Dtype SA01" \
@@ -482,10 +475,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
482475
-i "pandas.Series.to_timestamp RT03,SA01" \
483476
-i "pandas.Series.truediv PR07" \
484477
-i "pandas.Series.tz_convert SA01" \
485-
-i "pandas.Series.tz_localize SA01" \
486-
-i "pandas.Series.unstack SA01" \
487478
-i "pandas.Series.update PR07,SA01" \
488-
-i "pandas.Series.value_counts RT03" \
489479
-i "pandas.Series.var PR01,RT03,SA01" \
490480
-i "pandas.Series.where RT03" \
491481
-i "pandas.SparseDtype SA01" \

pandas/core/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ def value_counts(
924924
Returns
925925
-------
926926
Series
927+
Series containing counts of unique values.
927928
928929
See Also
929930
--------

pandas/core/frame.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -7162,7 +7162,7 @@ def value_counts(
71627162
dropna: bool = True,
71637163
) -> Series:
71647164
"""
7165-
Return a Series containing the frequency of each distinct row in the Dataframe.
7165+
Return a Series containing the frequency of each distinct row in the DataFrame.
71667166
71677167
Parameters
71687168
----------
@@ -7175,13 +7175,14 @@ def value_counts(
71757175
ascending : bool, default False
71767176
Sort in ascending order.
71777177
dropna : bool, default True
7178-
Don't include counts of rows that contain NA values.
7178+
Do not include counts of rows that contain NA values.
71797179
71807180
.. versionadded:: 1.3.0
71817181
71827182
Returns
71837183
-------
71847184
Series
7185+
Series containing the frequency of each distinct row in the DataFrame.
71857186
71867187
See Also
71877188
--------
@@ -7192,8 +7193,8 @@ def value_counts(
71927193
The returned Series will have a MultiIndex with one level per input
71937194
column but an Index (non-multi) for a single label. By default, rows
71947195
that contain any NA values are omitted from the result. By default,
7195-
the resulting Series will be in descending order so that the first
7196-
element is the most frequently-occurring row.
7196+
the resulting Series will be sorted by frequencies in descending order so that
7197+
the first element is the most frequently-occurring row.
71977198
71987199
Examples
71997200
--------
@@ -9658,6 +9659,8 @@ def unstack(
96589659
Returns
96599660
-------
96609661
Series or DataFrame
9662+
If index is a MultiIndex: DataFrame with pivoted index labels as new
9663+
inner-most level column labels, else Series.
96619664
96629665
See Also
96639666
--------
@@ -11494,7 +11497,7 @@ def any(
1149411497
**kwargs,
1149511498
) -> Series | bool: ...
1149611499

11497-
@doc(make_doc("any", ndim=2))
11500+
@doc(make_doc("any", ndim=1))
1149811501
def any(
1149911502
self,
1150011503
*,
@@ -11540,7 +11543,7 @@ def all(
1154011543
**kwargs,
1154111544
) -> Series | bool: ...
1154211545

11543-
@doc(make_doc("all", ndim=2))
11546+
@doc(make_doc("all", ndim=1))
1154411547
def all(
1154511548
self,
1154611549
axis: Axis | None = 0,

pandas/core/generic.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -10485,10 +10485,10 @@ def tz_localize(
1048510485
nonexistent: TimeNonexistent = "raise",
1048610486
) -> Self:
1048710487
"""
10488-
Localize tz-naive index of a Series or DataFrame to target time zone.
10488+
Localize time zone naive index of a Series or DataFrame to target time zone.
1048910489
1049010490
This operation localizes the Index. To localize the values in a
10491-
timezone-naive Series, use :meth:`Series.dt.tz_localize`.
10491+
time zone naive Series, use :meth:`Series.dt.tz_localize`.
1049210492
1049310493
Parameters
1049410494
----------
@@ -10548,13 +10548,19 @@ def tz_localize(
1054810548
Returns
1054910549
-------
1055010550
{klass}
10551-
Same type as the input.
10551+
Same type as the input, with time zone naive or aware index, depending on
10552+
``tz``.
1055210553
1055310554
Raises
1055410555
------
1055510556
TypeError
1055610557
If the TimeSeries is tz-aware and tz is not None.
1055710558
10559+
See Also
10560+
--------
10561+
Series.dt.tz_localize: Localize the values in a time zone naive Series.
10562+
Timestamp.tz_localize: Localize the Timestamp to a timezone.
10563+
1055810564
Examples
1055910565
--------
1056010566
Localize local times:
@@ -11712,7 +11718,7 @@ def last_valid_index(self) -> Hashable:
1171211718
skipna : bool, default True
1171311719
Exclude NA/null values when computing the result.
1171411720
numeric_only : bool, default False
11715-
Include only float, int, boolean columns. Not implemented for Series.
11721+
Include only float, int, boolean columns.
1171611722
1171711723
{min_count}\
1171811724
**kwargs
@@ -11881,9 +11887,9 @@ def last_valid_index(self) -> Hashable:
1188111887
1188211888
Returns
1188311889
-------
11884-
{name1} or {name2}
11885-
If level is specified, then, {name2} is returned; otherwise, {name1}
11886-
is returned.
11890+
{name2} or {name1}
11891+
If axis=None, then a scalar boolean is returned.
11892+
Otherwise a Series is returned with index matching the index argument.
1188711893
1188811894
{see_also}
1188911895
{examples}"""

pandas/core/series.py

+4
Original file line numberDiff line numberDiff line change
@@ -4257,6 +4257,10 @@ def unstack(
42574257
DataFrame
42584258
Unstacked Series.
42594259
4260+
See Also
4261+
--------
4262+
DataFrame.unstack : Pivot the MultiIndex of a DataFrame.
4263+
42604264
Notes
42614265
-----
42624266
Reference :ref:`the user guide <reshaping.stacking>` for more examples.

pandas/io/html.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -584,14 +584,8 @@ class _BeautifulSoupHtml5LibFrameParser(_HtmlFrameParser):
584584
:class:`pandas.io.html._HtmlFrameParser`.
585585
"""
586586

587-
def __init__(self, *args, **kwargs) -> None:
588-
super().__init__(*args, **kwargs)
589-
from bs4 import SoupStrainer
590-
591-
self._strainer = SoupStrainer("table")
592-
593587
def _parse_tables(self, document, match, attrs):
594-
element_name = self._strainer.name
588+
element_name = "table"
595589
tables = document.find_all(element_name, attrs=attrs)
596590
if not tables:
597591
raise ValueError("No tables found")

pyproject.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ setup = ['--vsenv'] # For Windows
152152
skip = "cp36-* cp37-* cp38-* pp* *_i686 *_ppc64le *_s390x"
153153
build-verbosity = "3"
154154
environment = {LDFLAGS="-Wl,--strip-all"}
155+
# TODO: remove this once numpy 2.0 proper releases
156+
# and specify numpy 2.0 as a dependency in [build-system] requires in pyproject.toml
157+
before-build = "pip install numpy==2.0.0rc1"
155158
test-requires = "hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0"
156159
test-command = """
157160
PANDAS_CI='1' python -c 'import pandas as pd; \
@@ -160,7 +163,9 @@ test-command = """
160163
"""
161164

162165
[tool.cibuildwheel.windows]
163-
before-build = "pip install delvewheel"
166+
# TODO: remove this once numpy 2.0 proper releases
167+
# and specify numpy 2.0 as a dependency in [build-system] requires in pyproject.toml
168+
before-build = "pip install delvewheel numpy==2.0.0rc1"
164169
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
165170

166171
[[tool.cibuildwheel.overrides]]

0 commit comments

Comments
 (0)