cudf.DatetimeIndex#
- class cudf.DatetimeIndex(data, *args, **kwargs)#
Immutable , ordered and sliceable sequence of datetime64 data, represented internally as int64.
- Parameters:
- dataarray-like (1-dimensional), optional
Optional datetime-like data to construct index with.
- copybool
Make a copy of input.
- freqstr, optional
This is not yet supported
- tzpytz.timezone or dateutil.tz.tzfile
This is not yet supported
- ambiguous‘infer’, bool-ndarray, ‘NaT’, default ‘raise’
This is not yet supported
- nameobject
Name to be stored in the index.
- dayfirstbool, default False
If True, parse dates in data with the day first order. This is not yet supported
- yearfirstbool, default False
If True parse dates in data with the year first order. This is not yet supported
- Returns:
- DatetimeIndex
Examples
>>> import cudf >>> cudf.DatetimeIndex([1, 2, 3, 4], name="a") DatetimeIndex(['1970-01-01 00:00:00.000000001', '1970-01-01 00:00:00.000000002', '1970-01-01 00:00:00.000000003', '1970-01-01 00:00:00.000000004'], dtype='datetime64[ns]', name='a')
Attributes
The year of the datetime.
The month as January=1, December=12.
The day of the datetime.
The hours of the datetime.
The minutes of the datetime.
The seconds of the datetime.
The microseconds of the datetime.
The nanoseconds of the datetime.
The day of the year, from 1-365 in non-leap years and from 1-366 in leap years.
The day of the year, from 1-365 in non-leap years and from 1-366 in leap years.
The day of the week with Monday=0, Sunday=6.
Integer indicator for which quarter of the year the date belongs in.
date
time
freq
Methods
ceil
(freq)Perform ceil operation on the data to the specified freq.
floor
(freq)Perform floor operation on the data to the specified freq.
round
(freq)Perform round operation on the data to the specified freq.
tz_convert
(tz)Convert tz-aware datetimes from one time zone to another.
tz_localize
(tz[, ambiguous, nonexistent])Localize timezone-naive data to timezone-aware data.