From 6e4a6eed7c33cd9be1925ad9338d353484d1c743 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Fri, 30 Aug 2024 14:02:16 +0530 Subject: [PATCH] DOC: fix SA01,ES01 for pandas.NaT --- ci/code_checks.sh | 1 - pandas/_libs/tslibs/nattype.pyx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 9012dc6559a13..a26ac9e46f363 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -72,7 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \ -i "pandas.MultiIndex.reorder_levels RT03,SA01" \ -i "pandas.NA SA01" \ - -i "pandas.NaT SA01" \ -i "pandas.Period.freq GL08" \ -i "pandas.Period.freqstr SA01" \ -i "pandas.Period.ordinal GL08" \ diff --git a/pandas/_libs/tslibs/nattype.pyx b/pandas/_libs/tslibs/nattype.pyx index 41011ff13737a..25d9510bcd543 100644 --- a/pandas/_libs/tslibs/nattype.pyx +++ b/pandas/_libs/tslibs/nattype.pyx @@ -348,6 +348,22 @@ class NaTType(_NaT): """ (N)ot-(A)-(T)ime, the time equivalent of NaN. + NaT is used to denote missing or null values in datetime and timedelta objects + in pandas. It functions similarly to how NaN is used for numerical data. + Operations with NaT will generally propagate the NaT value, similar to NaN. + NaT can be used in pandas data structures like Series and DataFrame + to represent missing datetime values. It is useful in data analysis + and time series analysis when working with incomplete or sparse + time-based data. Pandas provides robust handling of NaT to ensure + consistency and reliability in computations involving datetime objects. + + See Also + -------- + NA : NA ("not available") missing value indicator. + isna : Detect missing values (NaN or NaT) in an array-like object. + notna : Detect non-missing values. + numpy.nan : Floating point representation of Not a Number (NaN) for numerical data. + Examples -------- >>> pd.DataFrame([pd.Timestamp("2023"), np.nan], columns=["col_1"])