Skip to content

Commit f0c8248

Browse files
authored
DOC: pd.Period and pd.period_range should document that they accept datetime, date and pd.Timestamp (#53611)
* Add additional valid types to 'value' * Use pandas.Timestamp instead of pd.Timestamp
1 parent 42cdb31 commit f0c8248

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/_libs/tslibs/period.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2656,7 +2656,7 @@ class Period(_Period):
26562656
26572657
Parameters
26582658
----------
2659-
value : Period or str, default None
2659+
value : Period, str, datetime, date or pandas.Timestamp, default None
26602660
The time period represented (e.g., '4Q2005'). This represents neither
26612661
the start or the end of the period, but rather the entire period itself.
26622662
freq : str, default None

pandas/core/indexes/period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def period_range(
476476
477477
Parameters
478478
----------
479-
start : str or period-like, default None
479+
start : str, datetime, date, pandas.Timestamp, or period-like, default None
480480
Left bound for generating periods.
481481
end : str or period-like, default None
482482
Right bound for generating periods.

0 commit comments

Comments
 (0)