Skip to content

Commit 0af0ae4

Browse files
Revert parameter capitalization, remove whatsnew entry, override strftime
1 parent d8d1407 commit 0af0ae4

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

doc/source/whatsnew/v1.2.0.rst

-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ level-by-level basis.
207207

208208
Other enhancements
209209
^^^^^^^^^^^^^^^^^^
210-
- Added SS02 check to ``code_checks.sh``. This will add a check in CI to make sure summary in docstrings begins with capital letter. (:issue:`25113`)
211210
- Added ``day_of_week``(compatibility alias ``dayofweek``) property to ``Timestamp``, ``DatetimeIndex``, ``Period``, ``PeriodIndex`` (:issue:`9605`)
212211
- Added ``day_of_year`` (compatibility alias ``dayofyear``) property to ``Timestamp``, ``DatetimeIndex``, ``Period``, ``PeriodIndex`` (:issue:`9605`)
213212
- Added :meth:`~DataFrame.set_flags` for setting table-wide flags on a ``Series`` or ``DataFrame`` (:issue:`28394`)

pandas/_libs/tslibs/timestamps.pyx

+17-2
Original file line numberDiff line numberDiff line change
@@ -912,10 +912,25 @@ class Timestamp(_Timestamp):
912912
"""
913913
Timestamp.fromtimestamp(ts)
914914
915-
Timestamp[, tz] -> tz's local time from POSIX timestamp.
915+
Transform timestamp[, tz] to tz's local time from POSIX timestamp.
916916
"""
917917
return cls(datetime.fromtimestamp(ts))
918918

919+
@classmethod
920+
def strftime(cls, format):
921+
"""
922+
Timestamp.strftime(format)
923+
924+
Return a string representing the given POSIX timestamp
925+
controlled by an explicit format string.
926+
927+
Parameters
928+
----------
929+
format : str
930+
Format string to convert Timestamp to string.
931+
"""
932+
return cls(datetime.strftime(format))
933+
919934
# Issue 25016.
920935
@classmethod
921936
def strptime(cls, date_string, format):
@@ -934,7 +949,7 @@ class Timestamp(_Timestamp):
934949
"""
935950
Timestamp.combine(date, time)
936951
937-
Date, time -> datetime with same date and time fields.
952+
Combine date, time into datetime with same date and time fields.
938953
"""
939954
return cls(datetime.combine(date, time))
940955

0 commit comments

Comments
 (0)