DOC: CategoricalIndex doc string by topper-123 · Pull Request #24852 · pandas-dev/pandas (original) (raw)
The validation output is
################################################################################
################################## Validation ##################################
################################################################################
3 Errors found:
Parameters {fastpath} not documented
Parameter "dtype" type should use "str" instead of "string"
Examples do not pass tests
################################################################################
################################### Doctests ###################################
################################################################################
**********************************************************************
Line 73, in pandas.CategoricalIndex
Failed example:
pd.CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'])
Expected:
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'], categories=['a', 'b', 'c'], ordered=False, dtype='category') # noqa
Got:
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'], categories=['a', 'b', 'c'], ordered=False, dtype='category')
**********************************************************************
Line 79, in pandas.CategoricalIndex
Failed example:
pd.CategoricalIndex(c)
Expected:
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'], categories=['a', 'b', 'c'], ordered=False, dtype='category') # noqa
Got:
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'], categories=['a', 'b', 'c'], ordered=False, dtype='category')
**********************************************************************
Line 87, in pandas.CategoricalIndex
Failed example:
ci
Expected:
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'], categories=['c', 'b', 'a'], ordered=True, dtype='category') # noqa
Got:
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'], categories=['c', 'b', 'a'], ordered=True, dtype='category')
- Fastpath is deprecated, so it's ok not to add it to the doc string
- The dtype "string" is a ok, as this is a free text not a type.
- The examples do not pass the tests, because of the
# noqapart. That is needed to pass flake8.
so I think those reported errors are aceptable?