diff --git a/ci/code_checks.sh b/ci/code_checks.sh index a7a4bcf165f2a..27d54b8b8b855 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -103,7 +103,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.to_markdown SA01" \ -i "pandas.DataFrame.to_parquet RT03" \ -i "pandas.DataFrame.var PR01,RT03,SA01" \ - -i "pandas.DatetimeIndex.date SA01" \ -i "pandas.DatetimeIndex.day_of_year SA01" \ -i "pandas.DatetimeIndex.dayofyear SA01" \ -i "pandas.DatetimeIndex.freqstr SA01" \ @@ -115,7 +114,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DatetimeIndex.std PR01,RT03" \ -i "pandas.DatetimeIndex.to_period RT03" \ -i "pandas.DatetimeIndex.to_pydatetime RT03,SA01" \ - -i "pandas.DatetimeIndex.tz SA01" \ -i "pandas.DatetimeIndex.tz_convert RT03" \ -i "pandas.DatetimeTZDtype SA01" \ -i "pandas.DatetimeTZDtype.tz SA01" \ @@ -271,7 +269,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.dt.as_unit PR01,PR02" \ -i "pandas.Series.dt.ceil PR01,PR02" \ -i "pandas.Series.dt.components SA01" \ - -i "pandas.Series.dt.date SA01" \ -i "pandas.Series.dt.day_name PR01,PR02" \ -i "pandas.Series.dt.day_of_year SA01" \ -i "pandas.Series.dt.dayofyear SA01" \ @@ -291,7 +288,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.dt.strftime PR01,PR02" \ -i "pandas.Series.dt.to_period PR01,PR02,RT03" \ -i "pandas.Series.dt.total_seconds PR01" \ - -i "pandas.Series.dt.tz SA01" \ -i "pandas.Series.dt.tz_convert PR01,PR02,RT03" \ -i "pandas.Series.dt.tz_localize PR01,PR02" \ -i "pandas.Series.dt.unit GL08" \ diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index fb9f047d432a1..203308b4f0dee 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -593,6 +593,13 @@ def tz(self) -> tzinfo | None: datetime.tzinfo, pytz.tzinfo.BaseTZInfo, dateutil.tz.tz.tzfile, or None Returns None when the array is tz-naive. + See Also + -------- + DatetimeIndex.tz_localize : Localize tz-naive DatetimeIndex to a + given time zone, or remove timezone from a tz-aware DatetimeIndex. + DatetimeIndex.tz_convert : Convert tz-aware DatetimeIndex from + one time zone to another. + Examples -------- For Series: @@ -1476,6 +1483,14 @@ def date(self) -> npt.NDArray[np.object_]: Namely, the date part of Timestamps without time and timezone information. + See Also + -------- + DatetimeIndex.time : Returns numpy array of :class:`datetime.time` objects. + The time part of the Timestamps. + DatetimeIndex.year : The year of the datetime. + DatetimeIndex.month : The month as January=1, December=12. + DatetimeIndex.day : The day of the datetime. + Examples -------- For Series: