pandas.DatetimeIndex¶
-
class
pandas.DatetimeIndex¶ Immutable ndarray of datetime64 data, represented internally as int64, and which can be boxed to Timestamp objects that are subclasses of datetime and carry metadata such as frequency information.
Parameters: data : array-like (1-dimensional), optional
Optional datetime-like data to construct index with
copy : bool
Make a copy of input ndarray
freq : string or pandas offset object, optional
One of pandas date offset strings or corresponding objects
start : starting value, datetime-like, optional
If data is None, start is used as the start point in generating regular timestamp data.
periods : int, optional, > 0
Number of periods to generate, if generating index. Takes precedence over end argument
end : end time, datetime-like, optional
If periods is none, generated index will extend to first conforming time on or just past end argument
closed : string or None, default None
Make the interval closed with respect to the given frequency to the ‘left’, ‘right’, or both sides (None)
tz : pytz.timezone or dateutil.tz.tzfile
ambiguous : ‘infer’, bool-ndarray, ‘NaT’, default ‘raise’
- ‘infer’ will attempt to infer fall dst-transition hours based on order
- bool-ndarray where True signifies a DST time, False signifies a non-DST time (note that this flag is only applicable for ambiguous times)
- ‘NaT’ will return NaT where there are ambiguous times
- ‘raise’ will raise an AmbiguousTimeError if there are ambiguous times
infer_dst : boolean, default False (DEPRECATED)
Attempt to infer fall dst-transition hours based on order
name : object
Name to be stored in the index
Attributes
Treturn the transpose, which is by definition self asi8asobjectbasereturn the base object if the memory of the underlying data is shared datareturn the data pointer of the underlying data dateReturns numpy array of datetime.date. dayThe days of the datetime dayofweekThe day of the week with Monday=0, Sunday=6 dayofyearThe ordinal day of the year days_in_monthThe number of days in the month daysinmonthThe number of days in the month dtypedtype_strflagsfreqget/set the frequncy of the Index freqstrreturn the frequency object as a string if its set, otherwise None has_duplicateshasnanshourThe hours of the datetime inferred_freqinferred_typeis_all_datesis_monotonicalias for is_monotonic_increasing (deprecated) is_monotonic_decreasingreturn if the index is monotonic decreasing (only equal or is_monotonic_increasingreturn if the index is monotonic increasing (only equal or is_month_endLogical indicating if last day of month (defined by frequency) is_month_startLogical indicating if first day of month (defined by frequency) is_normalizedis_quarter_endLogical indicating if last day of quarter (defined by frequency) is_quarter_startLogical indicating if first day of quarter (defined by frequency) is_uniqueis_year_endLogical indicating if last day of year (defined by frequency) is_year_startLogical indicating if first day of year (defined by frequency) itemsizereturn the size of the dtype of the item of the underlying data microsecondThe microseconds of the datetime millisecondThe milliseconds of the datetime minuteThe minutes of the datetime monthThe month as January=1, December=12 namenamesnanosecondThe nanoseconds of the datetime nbytesreturn the number of bytes in the underlying data ndimreturn the number of dimensions of the underlying data, by definition 1 nlevelsoffsetquarterThe quarter of the date resolutionsecondThe seconds of the datetime shapereturn a tuple of the shape of the underlying data sizereturn the number of elements in the underlying data stridesreturn the strides of the underlying data timeReturns numpy array of datetime.time. tztzinfoAlias for tz attribute valuesreturn the underlying data as an ndarray weekThe week ordinal of the year weekdayThe day of the week with Monday=0, Sunday=6 weekofyearThe week ordinal of the year yearThe year of the datetime Methods