Immutable ndarray-like of datetime64 data.
Represented internally as int64, and which can be boxed to Timestamp objects that are subclasses of datetime and carry metadata.
Changed in version 2.0.0: The various numeric date/time attributes (day
, month
, year
etc.) now have dtype int32
. Previously they had dtype int64
.
Datetime-like data to construct index with.
One of pandas date offset strings or corresponding objects. The string âinferâ can be passed in order to set the frequency of the index as the inferred frequency upon creation.
Set the Timezone of the data.
Normalize start/end dates to midnight before generating date range.
Deprecated since version 2.1.0.
Set whether to include start and end that are on the boundary. The default includes boundary points on either end.
Deprecated since version 2.1.0.
When clocks moved backward due to DST, ambiguous times may arise. For example in Central European Time (UTC+01), when going from 03:00 DST to 02:00 non-DST, 02:30:00 local time occurs both at 00:30:00 UTC and at 01:30:00 UTC. In such a situation, the ambiguous parameter dictates how ambiguous times should be handled.
â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.
If True, parse dates in data with the day first order.
If True parse dates in data with the year first order.
Note that the only NumPy dtype allowed is datetime64[ns].
Make a copy of input ndarray.
Name to be stored in the index.
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.
Returns numpy array of python datetime.date
objects.
Returns numpy array of datetime.time
objects.
Returns numpy array of datetime.time
objects with timezones.
The ordinal day of the year.
The ordinal day of the year.
The day of the week with Monday=0, Sunday=6.
The day of the week with Monday=0, Sunday=6.
The day of the week with Monday=0, Sunday=6.
The quarter of the date.
Return the timezone.
Return the frequency object as a string if it's set, otherwise None.
Indicates whether the date is the first day of the month.
Indicates whether the date is the last day of the month.
Indicator for whether the date is the first day of a quarter.
Indicator for whether the date is the last day of a quarter.
Indicate whether the date is the first day of a year.
Indicate whether the date is the last day of the year.
Boolean indicator if the date belongs to a leap year.
Tries to return a string representing a frequency generated by infer_freq.
Methods
normalize
(*args, **kwargs)
Convert times to midnight.
strftime
(date_format)
Convert to Index using specified date_format.
snap
([freq])
Snap time stamps to nearest occurring frequency.
tz_convert
(tz)
Convert tz-aware Datetime Array/Index from one time zone to another.
tz_localize
(tz[, ambiguous, nonexistent])
Localize tz-naive Datetime Array/Index to tz-aware Datetime Array/Index.
round
(*args, **kwargs)
Perform round operation on the data to the specified freq.
floor
(*args, **kwargs)
Perform floor operation on the data to the specified freq.
ceil
(*args, **kwargs)
Perform ceil operation on the data to the specified freq.
to_period
(*args, **kwargs)
Cast to PeriodArray/PeriodIndex at a particular frequency.
to_pydatetime
(*args, **kwargs)
Return an ndarray of datetime.datetime
objects.
to_series
([index, name])
Create a Series with both index and values equal to the index keys.
to_frame
([index, name])
Create a DataFrame with a column containing the Index.
month_name
(*args, **kwargs)
Return the month names with specified locale.
day_name
(*args, **kwargs)
Return the day names with specified locale.
mean
(*[, skipna, axis])
Return the mean value of the Array.
std
(*args, **kwargs)
Return sample standard deviation over requested axis.
Notes
To learn more about the frequency strings, please see this link.
Examples
>>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"]) >>> idx DatetimeIndex(['2020-01-01 10:00:00+00:00', '2020-02-01 11:00:00+00:00'], dtype='datetime64[ns, UTC]', freq=None)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4