From 06cd55b64bf216489fec1197dff7f825fe3a9c88 Mon Sep 17 00:00:00 2001 From: Amanda Bizzinotto Date: Mon, 12 Jun 2023 20:23:35 -0300 Subject: [PATCH 1/3] Update docstrings for pandas.Period and period_range --- pandas/_libs/tslibs/period.pyx | 1 + pandas/core/indexes/period.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index e954ec9bccd9e..e3b5fd555cd48 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -2663,6 +2663,7 @@ class Period(_Period): One of pandas period strings or corresponding objects. Accepted strings are listed in the :ref:`offset alias section ` in the user docs. + If value is not already period-like, freq is required. ordinal : int, default None The period offset from the proleptic Gregorian epoch. year : int, default None diff --git a/pandas/core/indexes/period.py b/pandas/core/indexes/period.py index f40d63c8b8128..fd7cab0344e42 100644 --- a/pandas/core/indexes/period.py +++ b/pandas/core/indexes/period.py @@ -478,7 +478,7 @@ def period_range( ---------- start : str, datetime, date, pandas.Timestamp, or period-like, default None Left bound for generating periods. - end : str or period-like, default None + end : str, datetime, date, pandas.Timestamp, or period-like, default None Right bound for generating periods. periods : int, default None Number of periods to generate. From 7d0a1795c948d1235008e06555e25fc797c7a916 Mon Sep 17 00:00:00 2001 From: Amanda Bizzinotto Date: Tue, 13 Jun 2023 13:57:59 -0300 Subject: [PATCH 2/3] Fix Period docstring comment --- pandas/_libs/tslibs/period.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index e3b5fd555cd48..4fe43d3b7dfd9 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -2663,7 +2663,7 @@ class Period(_Period): One of pandas period strings or corresponding objects. Accepted strings are listed in the :ref:`offset alias section ` in the user docs. - If value is not already period-like, freq is required. + If value is None or datetime, freq is required. ordinal : int, default None The period offset from the proleptic Gregorian epoch. year : int, default None From a9d8b9823e38795e272e879b0eb0032a7d3a1ae1 Mon Sep 17 00:00:00 2001 From: Amanda Bizzinotto Date: Thu, 22 Jun 2023 20:44:16 -0300 Subject: [PATCH 3/3] Fix Period value docstring --- pandas/_libs/tslibs/period.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 4fe43d3b7dfd9..3e4120e107975 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -2663,7 +2663,7 @@ class Period(_Period): One of pandas period strings or corresponding objects. Accepted strings are listed in the :ref:`offset alias section ` in the user docs. - If value is None or datetime, freq is required. + If value is datetime, freq is required. ordinal : int, default None The period offset from the proleptic Gregorian epoch. year : int, default None