diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ca5b5c9b896b..33e23e8ddb206 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: hooks: - id: black - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.1 hooks: - id: codespell types_or: [python, rst, markdown] diff --git a/pandas/core/resample.py b/pandas/core/resample.py index e3d81e01ac94c..85731bbde6d40 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -1045,7 +1045,7 @@ def quantile(self, q=0.5, **kwargs): Return a DataFrame, where the columns are the columns of self, and the values are the quantiles. DataFrameGroupBy.quantile - Return a DataFrame, where the coulmns are groupby columns, + Return a DataFrame, where the columns are groupby columns, and the values are its quantiles. """ return self._downsample("quantile", q=q, **kwargs) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index a2a9079642344..21db0023f4be7 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -828,7 +828,7 @@ def to_latex( ``display_value`` with the default structure: ``\ ``. Where there are multiple commands the latter is nested recursively, so that - the above example highlighed cell is rendered as + the above example highlighted cell is rendered as ``\cellcolor{red} \bfseries 4``. Occasionally this format does not suit the applied command, or diff --git a/pandas/io/parsers/python_parser.py b/pandas/io/parsers/python_parser.py index ff8c21ab89f30..5d5b497a04c04 100644 --- a/pandas/io/parsers/python_parser.py +++ b/pandas/io/parsers/python_parser.py @@ -1272,7 +1272,7 @@ def __next__(self) -> list[str]: else: line = next(self.f) # type: ignore[arg-type] # Note: 'colspecs' is a sequence of half-open intervals. - return [line[fromm:to].strip(self.delimiter) for (fromm, to) in self.colspecs] + return [line[from_:to].strip(self.delimiter) for (from_, to) in self.colspecs] class FixedWidthFieldParser(PythonParser): diff --git a/pandas/tests/arrays/categorical/test_constructors.py b/pandas/tests/arrays/categorical/test_constructors.py index 24f4dd4a1f64a..633a763dab80a 100644 --- a/pandas/tests/arrays/categorical/test_constructors.py +++ b/pandas/tests/arrays/categorical/test_constructors.py @@ -450,7 +450,7 @@ def test_constructor_str_unknown(self): Categorical([1, 2], dtype="foo") def test_constructor_np_strs(self): - # GH#31499 Hastable.map_locations needs to work on np.str_ objects + # GH#31499 Hashtable.map_locations needs to work on np.str_ objects cat = Categorical(["1", "0", "1"], [np.str_("0"), np.str_("1")]) assert all(isinstance(x, np.str_) for x in cat.categories) diff --git a/pandas/tests/arrays/string_/test_string.py b/pandas/tests/arrays/string_/test_string.py index 6a17a56a47cbc..0a48d8e2a4983 100644 --- a/pandas/tests/arrays/string_/test_string.py +++ b/pandas/tests/arrays/string_/test_string.py @@ -178,15 +178,15 @@ def test_mul(dtype, request): @pytest.mark.xfail(reason="GH-28527") def test_add_strings(dtype): arr = pd.array(["a", "b", "c", "d"], dtype=dtype) - df = pd.DataFrame([["t", "u", "v", "w"]]) + df = pd.DataFrame([["t", "y", "v", "w"]]) assert arr.__add__(df) is NotImplemented result = arr + df - expected = pd.DataFrame([["at", "bu", "cv", "dw"]]).astype(dtype) + expected = pd.DataFrame([["at", "by", "cv", "dw"]]).astype(dtype) tm.assert_frame_equal(result, expected) result = df + arr - expected = pd.DataFrame([["ta", "ub", "vc", "wd"]]).astype(dtype) + expected = pd.DataFrame([["ta", "yb", "vc", "wd"]]).astype(dtype) tm.assert_frame_equal(result, expected) diff --git a/pandas/tests/config/test_config.py b/pandas/tests/config/test_config.py index cc394bbb23d00..85a3d6f89aa72 100644 --- a/pandas/tests/config/test_config.py +++ b/pandas/tests/config/test_config.py @@ -14,9 +14,9 @@ def setup_class(cls): from copy import deepcopy cls.cf = cf - cls.gc = deepcopy(getattr(cls.cf, "_global_config")) - cls.do = deepcopy(getattr(cls.cf, "_deprecated_options")) - cls.ro = deepcopy(getattr(cls.cf, "_registered_options")) + cls._global_config = deepcopy(getattr(cls.cf, "_global_config")) + cls._deprecated_options = deepcopy(getattr(cls.cf, "_deprecated_options")) + cls._registered_options = deepcopy(getattr(cls.cf, "_registered_options")) def setup_method(self): setattr(self.cf, "_global_config", {}) @@ -31,9 +31,9 @@ def setup_method(self): self.cf.register_option("chained_assignment", "raise") def teardown_method(self): - setattr(self.cf, "_global_config", self.gc) - setattr(self.cf, "_deprecated_options", self.do) - setattr(self.cf, "_registered_options", self.ro) + setattr(self.cf, "_global_config", self._global_config) + setattr(self.cf, "_deprecated_options", self._deprecated_options) + setattr(self.cf, "_registered_options", self._registered_options) def test_api(self): diff --git a/setup.cfg b/setup.cfg index f2314316f7732..53dfa2623c972 100644 --- a/setup.cfg +++ b/setup.cfg @@ -178,7 +178,7 @@ exclude = doc/source/getting_started/comparison/includes/*.rst [codespell] -ignore-words-list = ba,blocs,coo,hist,nd,sav,ser +ignore-words-list = blocs,coo,hist,nd,sav,ser,recuse ignore-regex = https://([\w/\.])+ [coverage:run]