Skip to content

Commit

Permalink
DOC: pd.Period and pd.period_range should document that they accept d…
Browse files Browse the repository at this point in the history
…atetime, date and pd.Timestamp (#53632)

* Update docstrings for pandas.Period and period_range

* Fix Period docstring comment

* Fix Period value docstring
  • Loading branch information
ABizzinotto authored Jun 23, 2023
1 parent 33199e1 commit 39c69da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2675,6 +2675,7 @@ class Period(_Period):
One of pandas period strings or corresponding objects. Accepted
strings are listed in the
:ref:`offset alias section <timeseries.offset_aliases>` in the user docs.
If value is datetime, freq is required.
ordinal : int, default None
The period offset from the proleptic Gregorian epoch.
year : int, default None
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 39c69da

Please sign in to comment.