From f10f344330e43224cd80239d0634161729ec56ce Mon Sep 17 00:00:00 2001 From: Amanda Bizzinotto Date: Sun, 11 Jun 2023 23:28:56 -0300 Subject: [PATCH 1/2] Add additional valid types to 'value' --- pandas/_libs/tslibs/period.pyx | 2 +- pandas/core/indexes/period.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 54bf041d59264..cae1800878537 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -2656,7 +2656,7 @@ class Period(_Period): Parameters ---------- - value : Period or str, default None + value : Period, str, datetime, date or pd.Timestamp, default None The time period represented (e.g., '4Q2005'). This represents neither the start or the end of the period, but rather the entire period itself. freq : str, default None diff --git a/pandas/core/indexes/period.py b/pandas/core/indexes/period.py index f693f9557ecdc..78ae6ec7c8c84 100644 --- a/pandas/core/indexes/period.py +++ b/pandas/core/indexes/period.py @@ -476,7 +476,7 @@ def period_range( Parameters ---------- - start : str or period-like, default None + start : str, datetime, date, pd.Timestamp, or period-like, default None Left bound for generating periods. end : str or period-like, default None Right bound for generating periods. From 6fe1040c2d197fc4d07358aa5a7da6167c24394d Mon Sep 17 00:00:00 2001 From: Amanda Bizzinotto Date: Sun, 11 Jun 2023 23:44:58 -0300 Subject: [PATCH 2/2] Use pandas.Timestamp instead of pd.Timestamp --- pandas/_libs/tslibs/period.pyx | 2 +- pandas/core/indexes/period.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index cae1800878537..e954ec9bccd9e 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -2656,7 +2656,7 @@ class Period(_Period): Parameters ---------- - value : Period, str, datetime, date or pd.Timestamp, default None + value : Period, str, datetime, date or pandas.Timestamp, default None The time period represented (e.g., '4Q2005'). This represents neither the start or the end of the period, but rather the entire period itself. freq : str, default None diff --git a/pandas/core/indexes/period.py b/pandas/core/indexes/period.py index 78ae6ec7c8c84..f40d63c8b8128 100644 --- a/pandas/core/indexes/period.py +++ b/pandas/core/indexes/period.py @@ -476,7 +476,7 @@ def period_range( Parameters ---------- - start : str, datetime, date, pd.Timestamp, or period-like, default None + start : str, datetime, date, pandas.Timestamp, or period-like, default None Left bound for generating periods. end : str or period-like, default None Right bound for generating periods.