Skip to content

Commit ff55fd2

Browse files
committed
Merge remote-tracking branch 'upstream/main' into improve-DataFrameGroupBy-std-ddof
2 parents ab50477 + 70bb855 commit ff55fd2

File tree

14 files changed

+138
-37
lines changed

14 files changed

+138
-37
lines changed

.circleci/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- run:
1717
name: Install Environment and Run Tests
1818
shell: /bin/bash -exo pipefail
19+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
1920
command: |
2021
MINI_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-24.3.0-0-Linux-aarch64.sh"
2122
wget -q $MINI_URL -O Miniforge3.sh
@@ -33,6 +34,7 @@ jobs:
3334
fi
3435
python -m pip install --no-build-isolation -ve . --config-settings=setup-args="--werror"
3536
PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH
37+
sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
3638
ci/run_tests.sh
3739
test-linux-musl:
3840
docker:
@@ -89,8 +91,8 @@ jobs:
8991
name: Build aarch64 wheels
9092
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
9193
command: |
92-
pip3 install cibuildwheel==2.18.1
93-
cibuildwheel --prerelease-pythons --output-dir wheelhouse
94+
pip3 install cibuildwheel==2.20.0
95+
cibuildwheel --output-dir wheelhouse
9496
9597
environment:
9698
CIBW_BUILD: << parameters.cibw-build >>

.github/workflows/code-checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ jobs:
5151
# TODO: The doctests have to be run first right now, since the Cython doctests only work
5252
# with pandas installed in non-editable mode
5353
# This can be removed once pytest-cython doesn't require C extensions to be installed inplace
54+
55+
- name: Extra installs
56+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
57+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
58+
5459
- name: Run doctests
5560
run: cd ci && ./code_checks.sh doctests
5661
if: ${{ steps.build.outcome == 'success' && always() }}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
- name: Build Pandas
4747
uses: ./.github/actions/build_pandas
4848

49+
- name: Extra installs
50+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
51+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
52+
4953
- name: Test website
5054
run: python -m pytest web/
5155

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ jobs:
134134
fetch-depth: 0
135135

136136
- name: Extra installs
137-
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.extra_apt }}
138-
if: ${{ matrix.extra_apt }}
137+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
138+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0 ${{ matrix.extra_apt || ''}}
139139

140140
- name: Generate extra locales
141141
# These extra locales will be available for locale.setlocale() calls in tests

.github/workflows/wheels.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,10 @@ jobs:
158158
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
159159

160160
- name: Build wheels
161-
uses: pypa/cibuildwheel@v2.19.2
161+
uses: pypa/cibuildwheel@v2.20.0
162162
with:
163163
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
164164
env:
165-
CIBW_PRERELEASE_PYTHONS: True
166165
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
167166
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}
168167
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}

ci/code_checks.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7070
--format=actions \
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
73-
-i "pandas.MultiIndex.get_level_values SA01" \
7473
-i "pandas.MultiIndex.get_loc_level PR07" \
7574
-i "pandas.MultiIndex.names SA01" \
7675
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
@@ -165,9 +164,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
165164
-i "pandas.Series.str.center RT03,SA01" \
166165
-i "pandas.Series.str.decode PR07,RT03,SA01" \
167166
-i "pandas.Series.str.encode PR07,RT03,SA01" \
168-
-i "pandas.Series.str.find RT03" \
169167
-i "pandas.Series.str.fullmatch RT03" \
170-
-i "pandas.Series.str.get RT03,SA01" \
171168
-i "pandas.Series.str.index RT03" \
172169
-i "pandas.Series.str.ljust RT03,SA01" \
173170
-i "pandas.Series.str.lower RT03" \
@@ -177,7 +174,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
177174
-i "pandas.Series.str.partition RT03" \
178175
-i "pandas.Series.str.repeat SA01" \
179176
-i "pandas.Series.str.replace SA01" \
180-
-i "pandas.Series.str.rfind RT03" \
181177
-i "pandas.Series.str.rindex RT03" \
182178
-i "pandas.Series.str.rjust RT03,SA01" \
183179
-i "pandas.Series.str.rpartition RT03" \
@@ -267,9 +263,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
267263
-i "pandas.api.extensions.ExtensionArray.tolist RT03,SA01" \
268264
-i "pandas.api.extensions.ExtensionArray.unique RT03,SA01" \
269265
-i "pandas.api.extensions.ExtensionArray.view SA01" \
270-
-i "pandas.api.indexers.VariableOffsetWindowIndexer PR01,SA01" \
271266
-i "pandas.api.interchange.from_dataframe RT03,SA01" \
272-
-i "pandas.api.types.is_any_real_numeric_dtype SA01" \
273267
-i "pandas.api.types.is_bool PR01,SA01" \
274268
-i "pandas.api.types.is_bool_dtype SA01" \
275269
-i "pandas.api.types.is_categorical_dtype SA01" \
@@ -296,7 +290,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
296290
-i "pandas.api.types.is_period_dtype SA01" \
297291
-i "pandas.api.types.is_re PR07,SA01" \
298292
-i "pandas.api.types.is_re_compilable PR07,SA01" \
299-
-i "pandas.api.types.is_sparse SA01" \
300293
-i "pandas.api.types.is_timedelta64_ns_dtype SA01" \
301294
-i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \
302295
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \

doc/source/user_guide/basics.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,6 @@ speedups. ``numexpr`` uses smart chunking, caching, and multiple cores. ``bottle
155155
a set of specialized cython routines that are especially fast when dealing with arrays that have
156156
``nans``.
157157

158-
Here is a sample (using 100 column x 100,000 row ``DataFrames``):
159-
160-
.. csv-table::
161-
:header: "Operation", "0.11.0 (ms)", "Prior Version (ms)", "Ratio to Prior"
162-
:widths: 25, 25, 25, 25
163-
164-
``df1 > df2``, 13.32, 125.35, 0.1063
165-
``df1 * df2``, 21.71, 36.63, 0.5928
166-
``df1 + df2``, 22.04, 36.50, 0.6039
167-
168158
You are highly encouraged to install both libraries. See the section
169159
:ref:`Recommended Dependencies <install.recommended_dependencies>` for more installation info.
170160

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ Strings
547547

548548
Interval
549549
^^^^^^^^
550+
- :meth:`Index.is_monotonic_decreasing`, :meth:`Index.is_monotonic_increasing`, and :meth:`Index.is_unique` could incorrectly be ``False`` for an ``Index`` created from a slice of another ``Index``. (:issue:`57911`)
550551
- Bug in :func:`interval_range` where start and end numeric types were always cast to 64 bit (:issue:`57268`)
551552
-
552553

pandas/_libs/index.pyx

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,24 @@ cdef class IndexEngine:
252252
return self.sizeof()
253253

254254
cpdef _update_from_sliced(self, IndexEngine other, reverse: bool):
255-
self.unique = other.unique
256-
self.need_unique_check = other.need_unique_check
255+
if other.unique:
256+
self.unique = other.unique
257+
self.need_unique_check = other.need_unique_check
258+
257259
if not other.need_monotonic_check and (
258260
other.is_monotonic_increasing or other.is_monotonic_decreasing):
259-
self.need_monotonic_check = other.need_monotonic_check
260-
# reverse=True means the index has been reversed
261-
self.monotonic_inc = other.monotonic_dec if reverse else other.monotonic_inc
262-
self.monotonic_dec = other.monotonic_inc if reverse else other.monotonic_dec
261+
self.need_monotonic_check = 0
262+
if len(self.values) > 0 and self.values[0] != self.values[-1]:
263+
# reverse=True means the index has been reversed
264+
if reverse:
265+
self.monotonic_inc = other.monotonic_dec
266+
self.monotonic_dec = other.monotonic_inc
267+
else:
268+
self.monotonic_inc = other.monotonic_inc
269+
self.monotonic_dec = other.monotonic_dec
270+
else:
271+
self.monotonic_inc = 1
272+
self.monotonic_dec = 1
263273

264274
@property
265275
def is_unique(self) -> bool:
@@ -882,14 +892,24 @@ cdef class SharedEngine:
882892
pass
883893

884894
cpdef _update_from_sliced(self, ExtensionEngine other, reverse: bool):
885-
self.unique = other.unique
886-
self.need_unique_check = other.need_unique_check
895+
if other.unique:
896+
self.unique = other.unique
897+
self.need_unique_check = other.need_unique_check
898+
887899
if not other.need_monotonic_check and (
888900
other.is_monotonic_increasing or other.is_monotonic_decreasing):
889-
self.need_monotonic_check = other.need_monotonic_check
890-
# reverse=True means the index has been reversed
891-
self.monotonic_inc = other.monotonic_dec if reverse else other.monotonic_inc
892-
self.monotonic_dec = other.monotonic_inc if reverse else other.monotonic_dec
901+
self.need_monotonic_check = 0
902+
if len(self.values) > 0 and self.values[0] != self.values[-1]:
903+
# reverse=True means the index has been reversed
904+
if reverse:
905+
self.monotonic_inc = other.monotonic_dec
906+
self.monotonic_dec = other.monotonic_inc
907+
else:
908+
self.monotonic_inc = other.monotonic_inc
909+
self.monotonic_dec = other.monotonic_dec
910+
else:
911+
self.monotonic_inc = 1
912+
self.monotonic_dec = 1
893913

894914
@property
895915
def is_unique(self) -> bool:

pandas/core/dtypes/common.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ def is_sparse(arr) -> bool:
187187
bool
188188
Whether or not the array-like is a pandas sparse array.
189189
190+
See Also
191+
--------
192+
api.types.SparseDtype : The dtype object for pandas sparse arrays.
193+
190194
Examples
191195
--------
192196
Returns `True` if the parameter is a 1-D pandas sparse array.
@@ -1181,6 +1185,12 @@ def is_any_real_numeric_dtype(arr_or_dtype) -> bool:
11811185
boolean
11821186
Whether or not the array or dtype is of a real number dtype.
11831187
1188+
See Also
1189+
--------
1190+
is_numeric_dtype : Check if a dtype is numeric.
1191+
is_complex_dtype : Check if a dtype is complex.
1192+
is_bool_dtype : Check if a dtype is boolean.
1193+
11841194
Examples
11851195
--------
11861196
>>> from pandas.api.types import is_any_real_numeric_dtype

0 commit comments

Comments
 (0)