pandas 1.4.2

AttributesMethodsNotesParametersBackRef

Attributes

year :
month :
day :
hour :
minute :
second :
microsecond :
nanosecond :
date :
time :
timetz :
dayofyear :
day_of_year :
weekofyear :
week :
dayofweek :
day_of_week :
weekday :
quarter :
tz :
freq :
freqstr :
is_month_start :
is_month_end :
is_quarter_start :
is_quarter_end :
is_year_start :
is_year_end :
is_leap_year :
inferred_freq :

Represented internally as int64, and which can be boxed to Timestamp objects that are subclasses of datetime and carry metadata.

Methods

Notes

To learn more about the frequency strings, please see :None:None:`this link <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`.

Parameters

data : array-like (1-dimensional), optional

Optional datetime-like data to construct index with.

freq : str or pandas offset object, optional

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.

tz : pytz.timezone or dateutil.tz.tzfile or datetime.tzinfo or str

Set the Timezone of the data.

normalize : bool, default False

Normalize start/end dates to midnight before generating date range.

closed : {'left', 'right'}, optional

Set whether to include :None:None:`start` and :None:None:`end` that are on the boundary. The default includes boundary points on either end.

ambiguous : 'infer', bool-ndarray, 'NaT', default 'raise'

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.

dayfirst : bool, default False

If True, parse dates in :None:None:`data` with the day first order.

yearfirst : bool, default False

If True parse dates in :None:None:`data` with the year first order.

dtype : numpy.dtype or DatetimeTZDtype or str, default None

Note that the only NumPy dtype allowed is ‘datetime64[ns]’.

copy : bool, default False

Make a copy of input ndarray.

name : label, default None

Name to be stored in the index.

Immutable ndarray-like of datetime64 data.

See Also

Index

The base pandas Index type.

PeriodIndex

Index of Period data.

TimedeltaIndex

Index of timedelta64 data.

date_range

Create a fixed-frequency DatetimeIndex.

to_datetime

Convert argument to datetime.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.indexes.period.PeriodIndex pandas.core.frame.DataFrame.resample pandas.core.indexes.timedeltas.TimedeltaIndex pandas.core.indexes.datetimes.date_range pandas.core.series.Series.resample pandas.core.indexes.base.Index pandas.core.generic.NDFrame.resample

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/indexes/datetimes.py#108
type: <class 'type'>
Commit: