@@ -369,7 +369,7 @@ cdef class _Timestamp(datetime):
369
369
class Timestamp (_Timestamp ):
370
370
""" Pandas replacement for datetime.datetime
371
371
372
- TimeStamp is the pandas equivalent of python's Datetime
372
+ Timestamp is the pandas equivalent of python's Datetime
373
373
and is interchangable with it in most cases. It's the type used
374
374
for the entries that make up a DatetimeIndex, and other timeseries
375
375
oriented data structures in pandas.
@@ -380,10 +380,11 @@ class Timestamp(_Timestamp):
380
380
Value to be converted to Timestamp
381
381
freq : str, DateOffset
382
382
Offset which Timestamp will have
383
- tz : string , pytz.timezone, dateutil.tz.tzfile or None
383
+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
384
384
Time zone for time which Timestamp will have.
385
- unit : string
386
- numpy unit used for conversion, if ts_input is int or float
385
+ unit : str
386
+ Unit used for conversion if ts_input is of type int or float.
387
+ For example, 's' means seconds and 'ms' means milliseconds.
387
388
offset : str, DateOffset
388
389
Deprecated, use freq
389
390
@@ -405,9 +406,19 @@ class Timestamp(_Timestamp):
405
406
406
407
Examples
407
408
--------
409
+ Using the primary calling convention:
410
+
408
411
>>> pd.Timestamp('2017-01-01T12')
409
412
Timestamp('2017-01-01 12:00:00')
410
413
414
+ >>> pd.Timestamp(1513393355.5, unit='s')
415
+ Timestamp('2017-12-16 03:02:35.500000')
416
+
417
+ >>> pd.Timestamp(1513393355, unit='s', tz='US/Pacific')
418
+ Timestamp('2017-12-15 19:02:35-0800', tz='US/Pacific')
419
+
420
+ Using the other two forms that minic the API for ``datetime.datetime``:
421
+
411
422
>>> pd.Timestamp(2017, 1, 1, 12)
412
423
Timestamp('2017-01-01 12:00:00')
413
424
@@ -429,7 +440,7 @@ class Timestamp(_Timestamp):
429
440
date corresponding to a proleptic Gregorian ordinal
430
441
freq : str, DateOffset
431
442
Offset which Timestamp will have
432
- tz : string , pytz.timezone, dateutil.tz.tzfile or None
443
+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
433
444
Time zone for time which Timestamp will have.
434
445
offset : str, DateOffset
435
446
Deprecated, use freq
@@ -447,7 +458,7 @@ class Timestamp(_Timestamp):
447
458
448
459
Parameters
449
460
----------
450
- tz : string / timezone object, default None
461
+ tz : str or timezone object, default None
451
462
Timezone to localize to
452
463
"""
453
464
if is_string_object(tz):
@@ -465,7 +476,7 @@ class Timestamp(_Timestamp):
465
476
466
477
Parameters
467
478
----------
468
- tz : string / timezone object, default None
479
+ tz : str or timezone object, default None
469
480
Timezone to localize to
470
481
"""
471
482
return cls .now(tz)
@@ -774,7 +785,7 @@ class Timestamp(_Timestamp):
774
785
775
786
Parameters
776
787
----------
777
- tz : string , pytz.timezone, dateutil.tz.tzfile or None
788
+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
778
789
Time zone for time which Timestamp will be converted to.
779
790
None will remove timezone holding local time.
780
791
@@ -828,7 +839,7 @@ class Timestamp(_Timestamp):
828
839
829
840
Parameters
830
841
----------
831
- tz : string , pytz.timezone, dateutil.tz.tzfile or None
842
+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
832
843
Time zone for time which Timestamp will be converted to.
833
844
None will remove timezone holding UTC time.
834
845
0 commit comments