Pandas version checks

  • [x] I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.api.indexers.check_array_indexer.html

Documentation problem

check_array_indexer also takes as input a single int or a slice as an argument for the indexer:

>>> import pandas as pd
>>> arr = pd.array([1, 2])
>>> pd.api.indexers.check_array_indexer(arr, 1)
1
>>> pd.api.indexers.check_array_indexer(arr, slice(0,1,1))
slice(0, 1, 1)

Not clear if this is a doc issue, or if the code should be checking that those arguments are invalid. I think they are valid since in the decimal extension array example, it is used in __setitem__() to check if the indexer is valid.

Suggested fix for documentation

Specify that a single int or slice is valid.

Comment From: rhshadrach

From the docstring:

Non-array indexers (integer, slice, Ellipsis, tuples, ..) are passed through as is.

Agreed they are valid.