Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « pandas »

Classe « DatetimeIndex »

Informations générales

Héritage

builtins.object
    DirNamesMixin
        PandasObject
builtins.object
    OpsMixin
        IndexOpsMixin
            Index
                NumericIndex
                    IntegerIndex
                        Int64Index
builtins.object
    DirNamesMixin
        PandasObject
builtins.object
    OpsMixin
        IndexOpsMixin
            Index
                ExtensionIndex
                    NDArrayBackedExtensionIndex
                        DatetimeIndexOpsMixin
                            DatetimeTimedeltaMixin
                                DatetimeIndex

Définition

class DatetimeIndex(DatetimeTimedeltaMixin):

Description [extrait de DatetimeIndex.__doc__]

    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.

    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 `start` and `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 `data` with the day first order.
    yearfirst : bool, default False
        If True parse dates in `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.

    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

    Methods
    -------
    normalize
    strftime
    snap
    tz_convert
    tz_localize
    round
    floor
    ceil
    to_period
    to_perioddelta
    to_pydatetime
    to_series
    to_frame
    month_name
    day_name
    mean
    std

    See Also
    --------
    Index : The base pandas Index type.
    TimedeltaIndex : Index of timedelta64 data.
    PeriodIndex : Index of Period data.
    to_datetime : Convert argument to datetime.
    date_range : Create a fixed-frequency DatetimeIndex.

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

Constructeur(s)

Signature du constructeur Description
__new__(cls, data=None, freq=<object object at 0x7f5051439e10>, tz=None, normalize=False, closed=None, ambiguous='raise', dayfirst=False, yearfirst=False, dtype=None, copy=False, name=None)

Liste des attributs statiques

Nom de l'attribut Valeur
array<pandas._libs.properties.CachedProperty object at 0x7f504b9fe2c0>
hasnans<pandas._libs.properties.CachedProperty object at 0x7f504b755080>
inferred_freq<pandas._libs.properties.CachedProperty object at 0x7f504b751d00>
is_all_dates<pandas._libs.properties.CachedProperty object at 0x7f504bd34c40>
is_normalized<pandas._libs.properties.CachedProperty object at 0x7f504b75ce80>
is_unique<pandas._libs.properties.CachedProperty object at 0x7f504bd34880>
resolution<pandas._libs.properties.CachedProperty object at 0x7f504b7554c0>

Attributs statiques hérités de la classe DatetimeTimedeltaMixin

dtype

Attributs statiques hérités de la classe NumericIndex

inferred_type

Liste des propriétés

Nom de la propriétéDescription
asi8
date
day
day_of_week
day_of_year
dayofweek
dayofyear
days_in_month
daysinmonth
dtype
empty
freq
freqstr
has_duplicates
hour
inferred_type
is_leap_year
is_monotonic
is_monotonic_decreasing
is_monotonic_increasing
is_month_end
is_month_start
is_quarter_end
is_quarter_start
is_year_end
is_year_start
microsecond
minute
month
name
names
nanosecond
nbytes
ndim
nlevels
quarter
second
shape
size
T
time
timetz
tz
tzinfo
values
week
weekday
weekofyear
year

Propriétés héritées de la classe IndexOpsMixin

array, is_unique

Liste des opérateurs

Opérateurs hérités de la classe IntegerIndex

__contains__

Liste des opérateurs

Opérateurs hérités de la classe ExtensionIndex

__getitem__

Liste des opérateurs

Opérateurs hérités de la classe Index

__and__, __iadd__, __inv__, __neg__, __or__, __pos__, __setitem__, __xor__

Liste des opérateurs

Opérateurs hérités de la classe OpsMixin

__add__, __eq__, __floordiv__, __ge__, __gt__, __le__, __lt__, __mod__, __mul__, __ne__, __pow__, __radd__, __rand__, __rfloordiv__, __rmod__, __rmul__, __ror__, __rpow__, __rsub__, __rtruediv__, __rxor__, __sub__, __truediv__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__reduce__(self)
get_loc(self, key, method=None, tolerance=None)
indexer_at_time(self, time, asof=False)
indexer_between_time(self, start_time, end_time, include_start=True, include_end=True)
isocalendar(self) -> 'DataFrame'
slice_indexer(self, start=None, end=None, step=None, kind=None)
snap(self, freq='S')
to_julian_date(self) -> 'Float64Index'
to_perioddelta(self, freq) -> 'TimedeltaIndex'
to_series(self, keep_tz=<object object at 0x7f5051439e10>, index=None, name=None)
tz_convert(self, tz) -> 'DatetimeIndex'
tz_localize(self, tz, ambiguous='raise', nonexistent='raise') -> 'DatetimeIndex'
union_many(self, others)

Méthodes héritées de la classe DatetimeTimedeltaMixin

__init_subclass__, __subclasshook__, difference, insert, intersection, is_type_compatible, join

Méthodes héritées de la classe DatetimeIndexOpsMixin

__array_wrap__, argmax, argmin, delete, equals, format, max, min, shift, take, tolist

Méthodes héritées de la classe NDArrayBackedExtensionIndex

putmask, where

Méthodes héritées de la classe ExtensionIndex

astype, map, repeat, searchsorted

Méthodes héritées de la classe Index

__abs__, __array__, __bool__, __copy__, __deepcopy__, __hash__, __len__, __nonzero__, __repr__, all, any, append, argsort, asof, asof_locs, copy, drop, drop_duplicates, droplevel, dropna, duplicated, fillna, get_indexer, get_indexer_for, get_indexer_non_unique, get_level_values, get_slice_bound, get_value, groupby, holds_integer, identical, is_, is_boolean, is_categorical, is_floating, is_integer, is_interval, is_mixed, is_numeric, is_object, isin, isna, isnull, memory_usage, notna, notnull, ravel, reindex, rename, set_names, set_value, slice_locs, sort, sort_values, sortlevel, symmetric_difference, to_flat_index, to_frame, to_native_types, union, unique, view

Méthodes héritées de la classe PandasObject

__sizeof__

Méthodes héritées de la classe DirNamesMixin

__dir__

Méthodes héritées de la classe IndexOpsMixin

__iter__, factorize, item, nunique, to_list, to_numpy, transpose, value_counts

Méthodes héritées de la classe OpsMixin

__divmod__, __rdivmod__

Méthodes héritées de la classe object

__delattr__, __format__, __getattribute__, __reduce_ex__, __setattr__, __str__