Skip to content

Commit 9e52b49

Browse files
albuzenetAlex
and
Alex
authored
DOC fix EX02 algorithms.factorize docstring (#51243)
* fix algorithms.factorize docstring * remove from exclusion list * fix dtypes --------- Co-authored-by: Alex <[email protected]>
1 parent f25c01d commit 9e52b49

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

ci/code_checks.sh

-3
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
579579
MSG='Partially validate docstrings (EX02)' ; echo $MSG
580580
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX02 --ignore_functions \
581581
pandas.DataFrame.plot.line \
582-
pandas.Index.factorize \
583582
pandas.Period.strftime \
584-
pandas.Series.factorize \
585583
pandas.Series.floordiv \
586584
pandas.Series.plot.line \
587585
pandas.Series.rfloordiv \
@@ -609,7 +607,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
609607
pandas.api.types.is_unsigned_integer_dtype \
610608
pandas.core.groupby.DataFrameGroupBy.take \
611609
pandas.core.groupby.SeriesGroupBy.take \
612-
pandas.factorize \
613610
pandas.io.formats.style.Styler.concat \
614611
pandas.io.formats.style.Styler.export \
615612
pandas.io.formats.style.Styler.set_td_classes \

pandas/core/algorithms.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ def factorize(
688688
689689
>>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'])
690690
>>> codes
691-
array([0, 0, 1, 2, 0]...)
691+
array([0, 0, 1, 2, 0])
692692
>>> uniques
693693
array(['b', 'a', 'c'], dtype=object)
694694
@@ -697,7 +697,7 @@ def factorize(
697697
698698
>>> codes, uniques = pd.factorize(['b', 'b', 'a', 'c', 'b'], sort=True)
699699
>>> codes
700-
array([1, 1, 0, 2, 1]...)
700+
array([1, 1, 0, 2, 1])
701701
>>> uniques
702702
array(['a', 'b', 'c'], dtype=object)
703703
@@ -707,7 +707,7 @@ def factorize(
707707
708708
>>> codes, uniques = pd.factorize(['b', None, 'a', 'c', 'b'])
709709
>>> codes
710-
array([ 0, -1, 1, 2, 0]...)
710+
array([ 0, -1, 1, 2, 0])
711711
>>> uniques
712712
array(['b', 'a', 'c'], dtype=object)
713713
@@ -718,7 +718,7 @@ def factorize(
718718
>>> cat = pd.Categorical(['a', 'a', 'c'], categories=['a', 'b', 'c'])
719719
>>> codes, uniques = pd.factorize(cat)
720720
>>> codes
721-
array([0, 0, 1]...)
721+
array([0, 0, 1])
722722
>>> uniques
723723
['a', 'c']
724724
Categories (3, object): ['a', 'b', 'c']
@@ -732,7 +732,7 @@ def factorize(
732732
>>> cat = pd.Series(['a', 'a', 'c'])
733733
>>> codes, uniques = pd.factorize(cat)
734734
>>> codes
735-
array([0, 0, 1]...)
735+
array([0, 0, 1])
736736
>>> uniques
737737
Index(['a', 'c'], dtype='object')
738738

0 commit comments

Comments
 (0)