@@ -372,7 +372,7 @@ cdef class _Timestamp(datetime):
372372class Timestamp (_Timestamp ):
373373 """ Pandas replacement for datetime.datetime
374374
375- TimeStamp is the pandas equivalent of python's Datetime
375+ Timestamp is the pandas equivalent of python's Datetime
376376 and is interchangable with it in most cases. It's the type used
377377 for the entries that make up a DatetimeIndex, and other timeseries
378378 oriented data structures in pandas.
@@ -383,10 +383,12 @@ class Timestamp(_Timestamp):
383383 Value to be converted to Timestamp
384384 freq : str, DateOffset
385385 Offset which Timestamp will have
386- tz : string , pytz.timezone, dateutil.tz.tzfile or None
386+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
387387 Time zone for time which Timestamp will have.
388- unit : string
389- numpy unit used for conversion, if ts_input is int or float
388+ unit : str
389+ Unit used for conversion if ts_input is of type int or float. The
390+ valid values are 'D', 'h', 'm', 's', 'ms', 'us', and 'ns'. For
391+ example, 's' means seconds and 'ms' means milliseconds.
390392 offset : str, DateOffset
391393 Deprecated, use freq
392394
@@ -408,9 +410,23 @@ class Timestamp(_Timestamp):
408410
409411 Examples
410412 --------
413+ Using the primary calling convention:
414+
415+ This converts a datetime-like string
411416 >>> pd.Timestamp('2017-01-01T12')
412417 Timestamp('2017-01-01 12:00:00')
413418
419+ This converts a float representing a Unix epoch in units of seconds
420+ >>> pd.Timestamp(1513393355.5, unit='s')
421+ Timestamp('2017-12-16 03:02:35.500000')
422+
423+ This converts an int representing a Unix-epoch in units of seconds
424+ and for a particular timezone
425+ >>> pd.Timestamp(1513393355, unit='s', tz='US/Pacific')
426+ Timestamp('2017-12-15 19:02:35-0800', tz='US/Pacific')
427+
428+ Using the other two forms that mimic the API for ``datetime.datetime``:
429+
414430 >>> pd.Timestamp(2017, 1, 1, 12)
415431 Timestamp('2017-01-01 12:00:00')
416432
@@ -432,7 +448,7 @@ class Timestamp(_Timestamp):
432448 date corresponding to a proleptic Gregorian ordinal
433449 freq : str, DateOffset
434450 Offset which Timestamp will have
435- tz : string , pytz.timezone, dateutil.tz.tzfile or None
451+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
436452 Time zone for time which Timestamp will have.
437453 offset : str, DateOffset
438454 Deprecated, use freq
@@ -450,7 +466,7 @@ class Timestamp(_Timestamp):
450466
451467 Parameters
452468 ----------
453- tz : string / timezone object, default None
469+ tz : str or timezone object, default None
454470 Timezone to localize to
455471 """
456472 if is_string_object(tz):
@@ -468,7 +484,7 @@ class Timestamp(_Timestamp):
468484
469485 Parameters
470486 ----------
471- tz : string / timezone object, default None
487+ tz : str or timezone object, default None
472488 Timezone to localize to
473489 """
474490 return cls .now(tz)
@@ -777,7 +793,7 @@ class Timestamp(_Timestamp):
777793
778794 Parameters
779795 ----------
780- tz : string , pytz.timezone, dateutil.tz.tzfile or None
796+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
781797 Time zone for time which Timestamp will be converted to.
782798 None will remove timezone holding local time.
783799
@@ -831,7 +847,7 @@ class Timestamp(_Timestamp):
831847
832848 Parameters
833849 ----------
834- tz : string , pytz.timezone, dateutil.tz.tzfile or None
850+ tz : str , pytz.timezone, dateutil.tz.tzfile or None
835851 Time zone for time which Timestamp will be converted to.
836852 None will remove timezone holding UTC time.
837853
0 commit comments