Skip to content

Commit aa6d611

Browse files
DOC: add SA01 for pandas.Period.now (#59202)
1 parent 262fcfb commit aa6d611

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9595
-i "pandas.Period.freq GL08" \
9696
-i "pandas.Period.freqstr SA01" \
9797
-i "pandas.Period.month SA01" \
98-
-i "pandas.Period.now SA01" \
9998
-i "pandas.Period.ordinal GL08" \
10099
-i "pandas.Period.strftime PR01,SA01" \
101100
-i "pandas.Period.to_timestamp SA01" \

pandas/_libs/tslibs/period.pyx

+13
Original file line numberDiff line numberDiff line change
@@ -2472,11 +2472,24 @@ cdef class _Period(PeriodMixin):
24722472
"""
24732473
Return the period of now's date.
24742474
2475+
The `now` method provides a convenient way to generate a period
2476+
object for the current date and time. This can be particularly
2477+
useful in financial and economic analysis, where data is often
2478+
collected and analyzed in regular intervals (e.g., hourly, daily,
2479+
monthly). By specifying the frequency, users can create periods
2480+
that match the granularity of their data.
2481+
24752482
Parameters
24762483
----------
24772484
freq : str, BaseOffset
24782485
Frequency to use for the returned period.
24792486
2487+
See Also
2488+
--------
2489+
to_datetime : Convert argument to datetime.
2490+
Period : Represents a period of time.
2491+
Period.to_timestamp : Return the Timestamp representation of the Period.
2492+
24802493
Examples
24812494
--------
24822495
>>> pd.Period.now('h') # doctest: +SKIP

0 commit comments

Comments
 (0)