Closed
Description
Pandas version checks
- 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.DatetimeIndex.html
Documentation problem
Docs for DatetimeIndex
say:
data: array-like (1-dimensional), optional
Optional datetime-like data to construct index with.
But data
isn't optional:
pd.DatetimeIndex()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<omitted>\site-packages\pandas\core\indexes\datetimes.py", line 321, in __new__
raise cls._scalar_data_error(data)
TypeError: DatetimeIndex(...) must be called with a collection of some kind, None was passed
Suggested fix for documentation
The word "optional" should be removed from that place in the documentation.