Skip to content

Commit a3e751c

Browse files
DOC: add SA01 for pandas.tseries.api.guess_datetime_format (#58756)
* DOC: add SA01 for pandas.tseries.api.guess_datetime_format * DOC: remove SA01 for pandas.tseries.api.guess_datetime_format * DOC: incorporate review suggestions Co-authored-by: mroeschke <[email protected]> --------- Co-authored-by: mroeschke <[email protected]>
1 parent 1a9a43d commit a3e751c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
522522
-i "pandas.testing.assert_index_equal PR07,SA01" \
523523
-i "pandas.testing.assert_series_equal PR07,SA01" \
524524
-i "pandas.timedelta_range SA01" \
525-
-i "pandas.tseries.api.guess_datetime_format SA01" \
526525
-i "pandas.tseries.offsets.BDay PR02,SA01" \
527526
-i "pandas.tseries.offsets.BMonthBegin PR02" \
528527
-i "pandas.tseries.offsets.BQuarterBegin PR02" \

pandas/_libs/tslibs/parsing.pyx

+10
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,10 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None:
859859
"""
860860
Guess the datetime format of a given datetime string.
861861

862+
This function attempts to deduce the format of a given datetime string. It is
863+
useful for situations where the datetime format is unknown and needs to be
864+
determined for proper parsing. The function is not guaranteed to return a format.
865+
862866
Parameters
863867
----------
864868
dt_str : str
@@ -876,6 +880,12 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None:
876880
datetime format string (for `strftime` or `strptime`),
877881
or None if it can't be guessed.
878882

883+
See Also
884+
--------
885+
to_datetime : Convert argument to datetime.
886+
Timestamp : Pandas replacement for python datetime.datetime object.
887+
DatetimeIndex : Immutable ndarray-like of datetime64 data.
888+
879889
Examples
880890
--------
881891
>>> from pandas.tseries.api import guess_datetime_format

0 commit comments

Comments
 (0)