Skip to content

Commit 573efc6

Browse files
committed
Address some codechecks
1 parent afe99dd commit 573efc6

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

pandas/core/algorithms.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def factorize(
698698
NaN values will be encoded as non-negative integers and will not drop the
699699
NaN from the uniques of the values.
700700
701-
{size_hint}\
701+
{size_hint}
702702
703703
Returns
704704
-------
@@ -730,7 +730,7 @@ def factorize(
730730
``pd.factorize(values)``. The results are identical for methods like
731731
:meth:`Series.factorize`.
732732
733-
>>> codes, uniques = pd.factorize(np.array(['b', 'b', 'a', 'c', 'b'], dtype="O"))
733+
>>> codes, uniques = pd.factorize(np.array(["b", "b", "a", "c", "b"], dtype="O"))
734734
>>> codes
735735
array([0, 0, 1, 2, 0])
736736
>>> uniques
@@ -739,8 +739,9 @@ def factorize(
739739
With ``sort=True``, the `uniques` will be sorted, and `codes` will be
740740
shuffled so that the relationship is the maintained.
741741
742-
>>> codes, uniques = pd.factorize(np.array(['b', 'b', 'a', 'c', 'b'], dtype="O"),
743-
... sort=True)
742+
>>> codes, uniques = pd.factorize(
743+
... np.array(["b", "b", "a", "c", "b"], dtype="O"), sort=True
744+
... )
744745
>>> codes
745746
array([1, 1, 0, 2, 1])
746747
>>> uniques
@@ -750,7 +751,7 @@ def factorize(
750751
the `codes` with the sentinel value ``-1`` and missing values are not
751752
included in `uniques`.
752753
753-
>>> codes, uniques = pd.factorize(np.array(['b', None, 'a', 'c', 'b'], dtype="O"))
754+
>>> codes, uniques = pd.factorize(np.array(["b", None, "a", "c", "b"], dtype="O"))
754755
>>> codes
755756
array([ 0, -1, 1, 2, 0])
756757
>>> uniques
@@ -760,7 +761,7 @@ def factorize(
760761
NumPy arrays). When factorizing pandas objects, the type of `uniques`
761762
will differ. For Categoricals, a `Categorical` is returned.
762763
763-
>>> cat = pd.Categorical(['a', 'a', 'c'], categories=['a', 'b', 'c'])
764+
>>> cat = pd.Categorical(["a", "a", "c"], categories=["a", "b", "c"])
764765
>>> codes, uniques = pd.factorize(cat)
765766
>>> codes
766767
array([0, 0, 1])
@@ -774,7 +775,7 @@ def factorize(
774775
For all other pandas objects, an Index of the appropriate type is
775776
returned.
776777
777-
>>> cat = pd.Series(['a', 'a', 'c'])
778+
>>> cat = pd.Series(["a", "a", "c"])
778779
>>> codes, uniques = pd.factorize(cat)
779780
>>> codes
780781
array([0, 0, 1])

pandas/core/strings/accessor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,6 @@ def cat(
848848
- If ``None`` and `pat` length is 1, treats `pat` as a literal string.
849849
- If ``None`` and `pat` length is not 1, treats `pat` as a regular expression.
850850
- Cannot be set to False if `pat` is a compiled regex
851-
852851
""",
853852
"raises_split": """
854853
Raises

pandas/core/window/doc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,5 @@ def window_agg_numba_parameters() -> str:
160160
and ``parallel`` dictionary keys. The values must either be ``True`` or
161161
``False``. The default ``engine_kwargs`` for the ``'numba'`` engine is
162162
``{{'nopython': True, 'nogil': False, 'parallel': False}}``
163-
\n
164163
"""
165-
).replace("\n", "", 1)
164+
)

0 commit comments

Comments
 (0)