Open
Description
In pandas/_typing.py
, we define ArrayLike
as:
ArrayLike = Union["ExtensionArray", np.ndarray]
In the numpy glossary https://numpy.org/doc/stable/glossary.html?highlight=array_like, numpy defines array_like
as:
Any scalar or sequence that can be interpreted as an ndarray. In addition to ndarrays and scalars this category includes lists (possibly nested and with different element types) and tuples. Any argument accepted by numpy.array is array_like.
Are we creating confusion by using the term ArrayLike
to only mean arrays, whereas numpy defines it to include scalars?
This came up in terms of reconciling the arguments of np.searchsorted()
and ExtensionArray.searchsorted()
.
Comments from @jbrockmendel and @simonjayhawkins welcome.