Module « pandas »
Classe « Timestamp »
Informations générales
Héritage
builtins.object
date
datetime
ABCTimestamp
_Timestamp
Timestamp
Définition
class Timestamp(_Timestamp):
Description [extrait de Timestamp.__doc__]
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.
freq : str, DateOffset
Offset which Timestamp will have.
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.
year, month, day : int
hour, minute, second, microsecond : int, optional, default 0
nanosecond : int, optional, default 0
tzinfo : datetime.tzinfo, optional, default None
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
.. versionadded:: 1.1.0
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 0x7f5051439e40>, freq=None, tz=None, unit=None, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, nanosecond=None, tzinfo=None, *, fold=None) |
|
Liste des attributs statiques
max | 2262-04-11 23:47:16.854775807 |
min | 1677-09-21 00:12:43.145225 |
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, freq, is_leap_year, is_month_end, is_month_start, is_quarter_end, is_quarter_start, is_year_end, is_year_start, nanosecond, quarter, value, week
Propriétés héritées de la classe datetime
fold, hour, microsecond, minute, second, tzinfo
Propriétés héritées de la classe date
day, month, year
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) |
|
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 |
string -> datetime from datetime.isoformat() output [extrait de fromisoformat.__doc__] |
fromordinal(ordinal, freq=None, tz=None) |
|
fromtimestamp(ts) |
|
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) |
|
to_julian_date(self) -> numpy.float64 |
|
today(tz=None) |
|
tz_convert(self, tz) |
|
tz_localize(self, tz, ambiguous='raise', nonexistent='raise') |
|
utcfromtimestamp(ts) |
|
utcnow() |
|
Méthodes héritées de la classe _Timestamp
__hash__, __init_subclass__, __reduce__, __reduce_ex__, __repr__, __setstate__, __subclasshook__, 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
__getattribute__,
__str__,
ctime,
date,
dst,
time,
timetuple,
timetz,
tzname,
utcoffset,
utctimetuple
Méthodes héritées de la classe date
__format__,
__getattribute__,
__str__,
ctime,
isocalendar,
isoweekday,
timetuple,
toordinal,
weekday
Méthodes héritées de la classe object
__delattr__,
__dir__,
__format__,
__getattribute__,
__setattr__,
__sizeof__,
__str__
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 :