Skip to content

Commit 82cc30f

Browse files
committed
Merge branch 'bugfix-spss-kwargs' of https://github.com/astronights/pandas into bugfix-spss-kwargs
2 parents 02c9006 + 3eea943 commit 82cc30f

File tree

420 files changed

+5137
-5081
lines changed

Some content is hidden

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

420 files changed

+5137
-5081
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ ci:
1818
# manual stage hooks
1919
skip: [pylint, pyright, mypy]
2020
repos:
21-
- repo: https://github.com/hauntsaninja/black-pre-commit-mirror
22-
# black compiled with mypyc
23-
rev: 23.11.0
24-
hooks:
25-
- id: black
2621
- repo: https://github.com/astral-sh/ruff-pre-commit
2722
rev: v0.1.6
2823
hooks:
@@ -35,6 +30,9 @@ repos:
3530
files: ^pandas
3631
exclude: ^pandas/tests
3732
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix]
33+
- id: ruff-format
34+
# TODO: "." not needed in ruff 0.1.8
35+
args: ["."]
3836
- repo: https://github.com/jendrikseipp/vulture
3937
rev: 'v2.10'
4038
hooks:
@@ -274,13 +272,6 @@ repos:
274272
language: python
275273
types: [rst]
276274
files: ^doc/source/(development|reference)/
277-
- id: unwanted-patterns-bare-pytest-raises
278-
name: Check for use of bare pytest raises
279-
language: python
280-
entry: python scripts/validate_unwanted_patterns.py --validation-type="bare_pytest_raises"
281-
types: [python]
282-
files: ^pandas/tests/
283-
exclude: ^pandas/tests/extension/
284275
- id: unwanted-patterns-private-function-across-module
285276
name: Check for use of private functions across modules
286277
language: python

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ RUN apt-get update && apt-get -y upgrade
55
RUN apt-get install -y build-essential
66

77
# hdf5 needed for pytables installation
8-
RUN apt-get install -y libhdf5-dev
8+
# libgles2-mesa needed for pytest-qt
9+
RUN apt-get install -y libhdf5-dev libgles2-mesa-dev
910

1011
RUN python -m pip install --upgrade pip
1112
RUN python -m pip install \

asv_bench/benchmarks/indexing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ def time_loc_slice(self, index, index_structure):
8484

8585
class NumericMaskedIndexing:
8686
monotonic_list = list(range(10**6))
87-
non_monotonic_list = (
88-
list(range(50)) + [54, 53, 52, 51] + list(range(55, 10**6 - 1))
89-
)
87+
non_monotonic_list = list(range(50)) + [54, 53, 52, 51] + list(range(55, 10**6 - 1))
9088

9189
params = [
9290
("Int64", "UInt64", "Float64"),

asv_bench/benchmarks/io/style.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def _style_format(self):
7676
# apply a formatting function
7777
# subset is flexible but hinders vectorised solutions
7878
self.st = self.df.style.format(
79-
"{:,.3f}", subset=IndexSlice["row_1":f"row_{ir}", "float_1":f"float_{ic}"]
79+
"{:,.3f}",
80+
subset=IndexSlice["row_1" : f"row_{ir}", "float_1" : f"float_{ic}"],
8081
)
8182

8283
def _style_apply_format_hide(self):

ci/code_checks.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@
1616

1717
set -uo pipefail
1818

19-
[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" || "$1" == "notebooks" ]] || \
19+
if [[ -v 1 ]]; then
20+
CHECK=$1
21+
else
22+
# script will fail if it uses an unset variable (i.e. $1 is not provided)
23+
CHECK=""
24+
fi
25+
26+
[[ -z "$CHECK" || "$CHECK" == "code" || "$CHECK" == "doctests" || "$CHECK" == "docstrings" || "$CHECK" == "single-docs" || "$CHECK" == "notebooks" ]] || \
2027
{ echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|single-docs|notebooks]"; exit 9999; }
2128

2229
BASE_DIR="$(dirname $0)/.."
2330
RET=0
24-
CHECK=$1
2531

2632
### CODE ###
2733
if [[ -z "$CHECK" || "$CHECK" == "code" ]]; then
@@ -145,10 +151,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
145151
pandas.io.formats.style.Styler.background_gradient \
146152
pandas.io.formats.style.Styler.text_gradient \
147153
pandas.DataFrame.values \
148-
pandas.DataFrame.loc \
149-
pandas.DataFrame.iloc \
150154
pandas.DataFrame.groupby \
151-
pandas.DataFrame.describe \
152155
pandas.DataFrame.skew \
153156
pandas.DataFrame.var \
154157
pandas.DataFrame.idxmax \

doc/source/development/contributing_codebase.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Pre-commit
3838
----------
3939

4040
Additionally, :ref:`Continuous Integration <contributing.ci>` will run code formatting checks
41-
like ``black``, ``ruff``,
41+
like ``ruff``,
4242
``isort``, and ``clang-format`` and more using `pre-commit hooks <https://pre-commit.com/>`_.
4343
Any warnings from these checks will cause the :ref:`Continuous Integration <contributing.ci>` to fail; therefore,
4444
it is helpful to run the check yourself before submitting code. This

doc/source/development/contributing_docstring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ Each shared docstring will have a base template with variables, like
939939
Finally, docstrings can also be appended to with the ``doc`` decorator.
940940

941941
In this example, we'll create a parent docstring normally (this is like
942-
``pandas.core.generic.NDFrame``. Then we'll have two children (like
942+
``pandas.core.generic.NDFrame``). Then we'll have two children (like
943943
``pandas.core.series.Series`` and ``pandas.core.frame.DataFrame``). We'll
944944
substitute the class names in this docstring.
945945

doc/source/reference/series.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Reindexing / selection / label manipulation
177177
:toctree: api/
178178

179179
Series.align
180+
Series.case_when
180181
Series.drop
181182
Series.droplevel
182183
Series.drop_duplicates

doc/source/user_guide/io.rst

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,20 +3471,15 @@ saving a ``DataFrame`` to Excel. Generally the semantics are
34713471
similar to working with :ref:`csv<io.read_csv_table>` data.
34723472
See the :ref:`cookbook<cookbook.excel>` for some advanced strategies.
34733473

3474-
.. warning::
3475-
3476-
The `xlrd <https://xlrd.readthedocs.io/en/latest/>`__ package is now only for reading
3477-
old-style ``.xls`` files.
3474+
.. note::
34783475

3479-
Before pandas 1.3.0, the default argument ``engine=None`` to :func:`~pandas.read_excel`
3480-
would result in using the ``xlrd`` engine in many cases, including new
3481-
Excel 2007+ (``.xlsx``) files. pandas will now default to using the
3482-
`openpyxl <https://openpyxl.readthedocs.io/en/stable/>`__ engine.
3476+
When ``engine=None``, the following logic will be used to determine the engine:
34833477

3484-
It is strongly encouraged to install ``openpyxl`` to read Excel 2007+
3485-
(``.xlsx``) files.
3486-
**Please do not report issues when using ``xlrd`` to read ``.xlsx`` files.**
3487-
This is no longer supported, switch to using ``openpyxl`` instead.
3478+
- If ``path_or_buffer`` is an OpenDocument format (.odf, .ods, .odt),
3479+
then `odf <https://pypi.org/project/odfpy/>`_ will be used.
3480+
- Otherwise if ``path_or_buffer`` is an xls format, ``xlrd`` will be used.
3481+
- Otherwise if ``path_or_buffer`` is in xlsb format, ``pyxlsb`` will be used.
3482+
- Otherwise ``openpyxl`` will be used.
34883483

34893484
.. _io.excel_reader:
34903485

doc/source/whatsnew/v2.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ In a future version, these will raise an error and you should cast to a common d
432432
433433
In [3]: ser[0] = 'not an int64'
434434
FutureWarning:
435-
Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas.
435+
Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas.
436436
Value 'not an int64' has dtype incompatible with int64, please explicitly cast to a compatible dtype first.
437437
438438
In [4]: ser

0 commit comments

Comments
 (0)