Skip to content

DOC: fix EX03 errors in docstrings - pandas.Timestamp - ceil, floor, round #56879

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 3 commits into from
Jan 15, 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
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.errors.SettingWithCopyWarning \
pandas.errors.SpecificationError \
pandas.errors.UndefinedVariableError \
pandas.Timestamp.ceil \
pandas.Timestamp.floor \
pandas.Timestamp.round \
pandas.read_json \
pandas.io.json.build_table_schema \
pandas.io.formats.style.Styler.to_latex \
Expand Down
24 changes: 12 additions & 12 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -973,16 +973,16 @@ timedelta}, default 'raise'

A timestamp can be rounded using multiple frequency units:

>>> ts.round(freq='h') # hour
>>> ts.round(freq='h') # hour
Timestamp('2020-03-14 16:00:00')

>>> ts.round(freq='min') # minute
>>> ts.round(freq='min') # minute
Timestamp('2020-03-14 15:33:00')

>>> ts.round(freq='s') # seconds
>>> ts.round(freq='s') # seconds
Timestamp('2020-03-14 15:32:52')

>>> ts.round(freq='ms') # milliseconds
>>> ts.round(freq='ms') # milliseconds
Timestamp('2020-03-14 15:32:52.193000')

``freq`` can also be a multiple of a single unit, like '5min' (i.e. 5 minutes):
Expand Down Expand Up @@ -1062,16 +1062,16 @@ timedelta}, default 'raise'

A timestamp can be floored using multiple frequency units:

>>> ts.floor(freq='h') # hour
>>> ts.floor(freq='h') # hour
Timestamp('2020-03-14 15:00:00')

>>> ts.floor(freq='min') # minute
>>> ts.floor(freq='min') # minute
Timestamp('2020-03-14 15:32:00')

>>> ts.floor(freq='s') # seconds
>>> ts.floor(freq='s') # seconds
Timestamp('2020-03-14 15:32:52')

>>> ts.floor(freq='ns') # nanoseconds
>>> ts.floor(freq='ns') # nanoseconds
Timestamp('2020-03-14 15:32:52.192548651')

``freq`` can also be a multiple of a single unit, like '5min' (i.e. 5 minutes):
Expand Down Expand Up @@ -1151,16 +1151,16 @@ timedelta}, default 'raise'

A timestamp can be ceiled using multiple frequency units:

>>> ts.ceil(freq='h') # hour
>>> ts.ceil(freq='h') # hour
Timestamp('2020-03-14 16:00:00')

>>> ts.ceil(freq='min') # minute
>>> ts.ceil(freq='min') # minute
Timestamp('2020-03-14 15:33:00')

>>> ts.ceil(freq='s') # seconds
>>> ts.ceil(freq='s') # seconds
Timestamp('2020-03-14 15:32:53')

>>> ts.ceil(freq='us') # microseconds
>>> ts.ceil(freq='us') # microseconds
Timestamp('2020-03-14 15:32:52.192549')

``freq`` can also be a multiple of a single unit, like '5min' (i.e. 5 minutes):
Expand Down
24 changes: 12 additions & 12 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1973,16 +1973,16 @@ timedelta}, default 'raise'

A timestamp can be rounded using multiple frequency units:

>>> ts.round(freq='h') # hour
>>> ts.round(freq='h') # hour
Timestamp('2020-03-14 16:00:00')

>>> ts.round(freq='min') # minute
>>> ts.round(freq='min') # minute
Timestamp('2020-03-14 15:33:00')

>>> ts.round(freq='s') # seconds
>>> ts.round(freq='s') # seconds
Timestamp('2020-03-14 15:32:52')

>>> ts.round(freq='ms') # milliseconds
>>> ts.round(freq='ms') # milliseconds
Timestamp('2020-03-14 15:32:52.193000')

``freq`` can also be a multiple of a single unit, like '5min' (i.e. 5 minutes):
Expand Down Expand Up @@ -2064,16 +2064,16 @@ timedelta}, default 'raise'

A timestamp can be floored using multiple frequency units:

>>> ts.floor(freq='h') # hour
>>> ts.floor(freq='h') # hour
Timestamp('2020-03-14 15:00:00')

>>> ts.floor(freq='min') # minute
>>> ts.floor(freq='min') # minute
Timestamp('2020-03-14 15:32:00')

>>> ts.floor(freq='s') # seconds
>>> ts.floor(freq='s') # seconds
Timestamp('2020-03-14 15:32:52')

>>> ts.floor(freq='ns') # nanoseconds
>>> ts.floor(freq='ns') # nanoseconds
Timestamp('2020-03-14 15:32:52.192548651')

``freq`` can also be a multiple of a single unit, like '5min' (i.e. 5 minutes):
Expand Down Expand Up @@ -2153,16 +2153,16 @@ timedelta}, default 'raise'

A timestamp can be ceiled using multiple frequency units:

>>> ts.ceil(freq='h') # hour
>>> ts.ceil(freq='h') # hour
Timestamp('2020-03-14 16:00:00')

>>> ts.ceil(freq='min') # minute
>>> ts.ceil(freq='min') # minute
Timestamp('2020-03-14 15:33:00')

>>> ts.ceil(freq='s') # seconds
>>> ts.ceil(freq='s') # seconds
Timestamp('2020-03-14 15:32:53')

>>> ts.ceil(freq='us') # microseconds
>>> ts.ceil(freq='us') # microseconds
Timestamp('2020-03-14 15:32:52.192549')

``freq`` can also be a multiple of a single unit, like '5min' (i.e. 5 minutes):
Expand Down