@@ -369,7 +369,7 @@ cdef class _Timestamp(datetime):
369369class Timestamp (_Timestamp ):
370370 """ Pandas replacement for datetime.datetime
371371
372- TimeStamp is the pandas equivalent of python's Datetime
372+ Timestamp is the pandas equivalent of python's Datetime
373373 and is interchangable with it in most cases. It's the type used
374374 for the entries that make up a DatetimeIndex, and other timeseries
375375 oriented data structures in pandas.
@@ -380,10 +380,12 @@ class Timestamp(_Timestamp):
380380 Value to be converted to Timestamp
381381 freq : str, DateOffset
382382 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
384384 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. The
387+ valid values are 'D', 'h', 'm', 's', 'ms', 'us', and 'ns'. For
388+ example, 's' means seconds and 'ms' means milliseconds.
387389 offset : str, DateOffset
388390 Deprecated, use freq
389391
@@ -405,9 +407,23 @@ class Timestamp(_Timestamp):
405407
406408 Examples
407409 --------
410+ Using the primary calling convention:
411+
412+ This converts a datetime-like string
408413 >>> pd.Timestamp('2017-01-01T12')
409414 Timestamp('2017-01-01 12:00:00')
410415
416+ This converts a float representing a Unix epoch in units of seconds
417+ >>> pd.Timestamp(1513393355.5, unit='s')
418+ Timestamp('2017-12-16 03:02:35.500000')
419+
420+ This converts an int representing a Unix-epoch in units of seconds
421+ and for a particular timezone
422+ >>> pd.Timestamp(1513393355, unit='s', tz='US/Pacific')
423+ Timestamp('2017-12-15 19:02:35-0800', tz='US/Pacific')
424+
425+ Using the other two forms that mimic the API for ``datetime.datetime``:
426+
411427 >>> pd.Timestamp(2017, 1, 1, 12)
412428 Timestamp('2017-01-01 12:00:00')
413429
@@ -429,7 +445,7 @@ class Timestamp(_Timestamp):
429445 date corresponding to a proleptic Gregorian ordinal
430446 freq : str, DateOffset
431447 Offset which Timestamp will have
432- tz : string , pytz.timezone, dateutil.tz.tzfile or None
448+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
433449 Time zone for time which Timestamp will have.
434450 offset : str, DateOffset
435451 Deprecated, use freq
@@ -447,7 +463,7 @@ class Timestamp(_Timestamp):
447463
448464 Parameters
449465 ----------
450- tz : string / timezone object, default None
466+ tz : str or timezone object, default None
451467 Timezone to localize to
452468 """
453469 if is_string_object(tz):
@@ -465,7 +481,7 @@ class Timestamp(_Timestamp):
465481
466482 Parameters
467483 ----------
468- tz : string / timezone object, default None
484+ tz : str or timezone object, default None
469485 Timezone to localize to
470486 """
471487 return cls .now(tz)
@@ -774,7 +790,7 @@ class Timestamp(_Timestamp):
774790
775791 Parameters
776792 ----------
777- tz : string , pytz.timezone, dateutil.tz.tzfile or None
793+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
778794 Time zone for time which Timestamp will be converted to.
779795 None will remove timezone holding local time.
780796
@@ -828,7 +844,7 @@ class Timestamp(_Timestamp):
828844
829845 Parameters
830846 ----------
831- tz : string , pytz.timezone, dateutil.tz.tzfile or None
847+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
832848 Time zone for time which Timestamp will be converted to.
833849 None will remove timezone holding UTC time.
834850
0 commit comments