Skip to content

DOC: add SA01 for pandas.Period.now #59202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Period.freq GL08" \
-i "pandas.Period.freqstr SA01" \
-i "pandas.Period.month SA01" \
-i "pandas.Period.now SA01" \
-i "pandas.Period.ordinal GL08" \
-i "pandas.Period.strftime PR01,SA01" \
-i "pandas.Period.to_timestamp SA01" \
Expand Down
13 changes: 13 additions & 0 deletions pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2472,11 +2472,24 @@ cdef class _Period(PeriodMixin):
"""
Return the period of now's date.

The `now` method provides a convenient way to generate a period
object for the current date and time. This can be particularly
useful in financial and economic analysis, where data is often
collected and analyzed in regular intervals (e.g., hourly, daily,
monthly). By specifying the frequency, users can create periods
that match the granularity of their data.

Parameters
----------
freq : str, BaseOffset
Frequency to use for the returned period.

See Also
--------
to_datetime : Convert argument to datetime.
Period : Represents a period of time.
Period.to_timestamp : Return the Timestamp representation of the Period.

Examples
--------
>>> pd.Period.now('h') # doctest: +SKIP
Expand Down
Loading