Skip to content

Commit 35e1aba

Browse files
jackgoldsmith4mroeschke
authored andcommitted
improve period constructor docs (pandas-dev#47321)
* improve period docs * Update pandas/_libs/tslibs/period.pyx Co-authored-by: Matthew Roeschke <[email protected]> Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 321769a commit 35e1aba

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/_libs/tslibs/period.pyx

+10-2
Original file line numberDiff line numberDiff line change
@@ -2483,9 +2483,11 @@ class Period(_Period):
24832483
Parameters
24842484
----------
24852485
value : Period or str, default None
2486-
The time period represented (e.g., '4Q2005').
2486+
The time period represented (e.g., '4Q2005'). This represents neither
2487+
the start or the end of the period, but rather the entire period itself.
24872488
freq : str, default None
2488-
One of pandas period strings or corresponding objects.
2489+
One of pandas period strings or corresponding objects. Accepted
2490+
strings are listed in the :ref:`offset alias section <timeseries.offset_aliases>` in the user docs.
24892491
ordinal : int, default None
24902492
The period offset from the proleptic Gregorian epoch.
24912493
year : int, default None
@@ -2502,6 +2504,12 @@ class Period(_Period):
25022504
Minute value of the period.
25032505
second : int, default 0
25042506
Second value of the period.
2507+
2508+
Examples
2509+
--------
2510+
>>> period = pd.Period('2012-1-1', freq='D')
2511+
>>> period
2512+
Period('2012-01-01', 'D')
25052513
"""
25062514

25072515
def __new__(cls, value=None, freq=None, ordinal=None,

0 commit comments

Comments
 (0)