Skip to content

Commit 684a291

Browse files
authored
DOC: Update the pandas.DatetimeIndex docstring (#32360)
1 parent 6852012 commit 684a291

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

pandas/core/indexes/datetimes.py

+17-8
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,26 @@ def _new_DatetimeIndex(cls, d):
7878
)
7979
class DatetimeIndex(DatetimeTimedeltaMixin):
8080
"""
81-
Immutable ndarray of datetime64 data, represented internally as int64, and
82-
which can be boxed to Timestamp objects that are subclasses of datetime and
83-
carry metadata such as frequency information.
81+
Immutable ndarray-like of datetime64 data.
82+
83+
Represented internally as int64, and which can be boxed to Timestamp objects
84+
that are subclasses of datetime and carry metadata.
8485
8586
Parameters
8687
----------
8788
data : array-like (1-dimensional), optional
8889
Optional datetime-like data to construct index with.
89-
copy : bool
90-
Make a copy of input ndarray.
9190
freq : str or pandas offset object, optional
9291
One of pandas date offset strings or corresponding objects. The string
9392
'infer' can be passed in order to set the frequency of the index as the
9493
inferred frequency upon creation.
95-
tz : pytz.timezone or dateutil.tz.tzfile
94+
tz : pytz.timezone or dateutil.tz.tzfile or datetime.tzinfo or str
95+
Set the Timezone of the data.
96+
normalize : bool, default False
97+
Normalize start/end dates to midnight before generating date range.
98+
closed : {'left', 'right'}, optional
99+
Set whether to include `start` and `end` that are on the
100+
boundary. The default includes boundary points on either end.
96101
ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'
97102
When clocks moved backward due to DST, ambiguous times may arise.
98103
For example in Central European Time (UTC+01), when going from 03:00
@@ -107,12 +112,16 @@ class DatetimeIndex(DatetimeTimedeltaMixin):
107112
times)
108113
- 'NaT' will return NaT where there are ambiguous times
109114
- 'raise' will raise an AmbiguousTimeError if there are ambiguous times.
110-
name : object
111-
Name to be stored in the index.
112115
dayfirst : bool, default False
113116
If True, parse dates in `data` with the day first order.
114117
yearfirst : bool, default False
115118
If True parse dates in `data` with the year first order.
119+
dtype : numpy.dtype or DatetimeTZDtype or str, default None
120+
Note that the only NumPy dtype allowed is ‘datetime64[ns]’.
121+
copy : bool, default False
122+
Make a copy of input ndarray.
123+
name : label, default None
124+
Name to be stored in the index.
116125
117126
Attributes
118127
----------

0 commit comments

Comments
 (0)