Vous êtes un professionnel et vous avez besoin d'une formation ?
RAG (Retrieval-Augmented Generation)et Fine Tuning d'un LLM
Voir le programme détaillé
Module « pandas »
Classe « Timestamp »
Informations générales
Héritage
builtins.object
date
datetime
ABCTimestamp
_Timestamp
Timestamp
Définition
class Timestamp(_Timestamp):
help(Timestamp)
Pandas replacement for python datetime.datetime object.
Timestamp is the pandas equivalent of python's Datetime
and is interchangeable with it in most cases. It's the type used
for the entries that make up a DatetimeIndex, and other timeseries
oriented data structures in pandas.
Parameters
----------
ts_input : datetime-like, str, int, float
Value to be converted to Timestamp.
year, month, day : int
hour, minute, second, microsecond : int, optional, default 0
tzinfo : datetime.tzinfo, optional, default None
nanosecond : int, optional, default 0
tz : str, pytz.timezone, dateutil.tz.tzfile or None
Time zone for time which Timestamp will have.
unit : str
Unit used for conversion if ts_input is of type int or float. The
valid values are 'D', 'h', 'm', 's', 'ms', 'us', and 'ns'. For
example, 's' means seconds and 'ms' means milliseconds.
For float inputs, the result will be stored in nanoseconds, and
the unit attribute will be set as ``'ns'``.
fold : {0, 1}, default None, keyword-only
Due to daylight saving time, one wall clock time can occur twice
when shifting from summer to winter time; fold describes whether the
datetime-like corresponds to the first (0) or the second time (1)
the wall clock hits the ambiguous time.
Notes
-----
There are essentially three calling conventions for the constructor. The
primary form accepts four parameters. They can be passed by position or
keyword.
The other two forms mimic the parameters from ``datetime.datetime``. They
can be passed by either position or keyword, but not both mixed together.
Examples
--------
Using the primary calling convention:
This converts a datetime-like string
>>> pd.Timestamp('2017-01-01T12')
Timestamp('2017-01-01 12:00:00')
This converts a float representing a Unix epoch in units of seconds
>>> pd.Timestamp(1513393355.5, unit='s')
Timestamp('2017-12-16 03:02:35.500000')
This converts an int representing a Unix-epoch in units of seconds
and for a particular timezone
>>> pd.Timestamp(1513393355, unit='s', tz='US/Pacific')
Timestamp('2017-12-15 19:02:35-0800', tz='US/Pacific')
Using the other two forms that mimic the API for ``datetime.datetime``:
>>> pd.Timestamp(2017, 1, 1, 12)
Timestamp('2017-01-01 12:00:00')
>>> pd.Timestamp(year=2017, month=1, day=1, hour=12)
Timestamp('2017-01-01 12:00:00')
Constructeur(s)
__new__(cls, ts_input=<object object at 0x0000020D9A5709B0>, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, tzinfo=None, *, nanosecond=None, tz=None, unit=None, fold=None) |
|
__init__(self, /, *args, **kwargs) |
Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__] |
Liste des attributs statiques
max | 2262-04-11 23:47:16.854775807 |
min | 1677-09-21 00:12:43.145224193 |
resolution | 0 days 00:00:00.000000001 |
Attributs statiques hérités de la classe _Timestamp
asm8, day_of_week, day_of_year, dayofweek, dayofyear, days_in_month, is_leap_year, is_month_end, is_month_start, is_quarter_end, is_quarter_start, is_year_end, is_year_start, nanosecond, quarter, unit, value, week, year
Attributs statiques hérités de la classe datetime
fold, hour, microsecond, minute, second, tzinfo
Attributs statiques hérités de la classe date
day, month
Liste des opérateurs
Opérateurs hérités de la classe _Timestamp
__add__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __radd__, __rsub__, __sub__
Liste des méthodes
Toutes les méthodes
Méthodes d'instance
Méthodes statiques
Méthodes dépréciées
astimezone(self, tz) |
|
ceil(self, freq, ambiguous='raise', nonexistent='raise') |
|
combine(date, time) |
|
ctime(self) |
|
date(self) |
|
dst(self) |
|
floor(self, freq, ambiguous='raise', nonexistent='raise') |
|
fromisocalendar |
int, int, int -> Construct a date from the ISO year, week number and weekday. [extrait de fromisocalendar.__doc__] |
fromisoformat(object) |
string -> datetime from a string in most ISO 8601 formats [extrait de fromisoformat.__doc__] |
fromordinal(ordinal, tz=None) |
|
fromtimestamp(ts, tz=None) |
|
isocalendar(self) |
|
isoweekday(self) |
|
now(tz=None) |
|
replace(self, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, nanosecond=None, tzinfo=<class 'object'>, fold=None) |
|
round(self, freq, ambiguous='raise', nonexistent='raise') |
|
strftime(self, format) |
|
strptime(date_string, format) |
|
time(self) |
|
timetuple(self) |
|
timetz(self) |
|
to_julian_date(self) -> 'np.float64' |
|
today(tz=None) |
|
toordinal(self) |
|
tz_convert(self, tz) |
|
tz_localize(self, tz, ambiguous='raise', nonexistent='raise') |
|
tzname(self) |
|
utcfromtimestamp(ts) |
|
utcnow() |
|
utcoffset(self) |
|
utctimetuple(self) |
|
weekday(self) |
|
Méthodes héritées de la classe _Timestamp
__hash__, __init_subclass__, __reduce__, __reduce_ex__, __repr__, __setstate__, __subclasshook__, as_unit, day_name, isoformat, month_name, normalize, timestamp, to_datetime64, to_numpy, to_period, to_pydatetime
Méthodes héritées de la classe ABCTimestamp
__reduce_cython__, __setstate_cython__
Méthodes héritées de la classe datetime
__replace__,
__str__
Méthodes héritées de la classe date
__format__,
__replace__,
__str__
Méthodes héritées de la classe object
__delattr__,
__dir__,
__format__,
__getattribute__,
__getstate__,
__setattr__,
__sizeof__,
__str__
Vous êtes un professionnel et vous avez besoin d'une formation ?
Machine Learning
avec Scikit-Learn
Voir le programme détaillé
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 :