diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 0714c6f74f0c2..495136c6fae25 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -110,9 +110,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.sparse.npoints SA01" \ -i "pandas.Series.sparse.sp_values SA01" \ -i "pandas.Timedelta.components SA01" \ - -i "pandas.Timedelta.max PR02" \ - -i "pandas.Timedelta.min PR02" \ - -i "pandas.Timedelta.resolution PR02" \ -i "pandas.Timedelta.to_numpy PR01" \ -i "pandas.Timedelta.to_timedelta64 SA01" \ -i "pandas.Timedelta.total_seconds SA01" \ diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 36be1812b0187..bb5dca9acbfd8 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1835,6 +1835,21 @@ class Timedelta(_Timedelta): Values for construction in compat with datetime.timedelta. Numpy ints and floats will be coerced to python ints and floats. + **Attributes + -------- + resolution: Timedelta + Represents the smallest difference between two time units that can be represented + by the Timedelta object. + Fixed at 0 days 00:00:00.000000001 (1 nanosecond). + min : Timedelta + Returns the minimum Timedelta value that can be created or used in + pandas operations. + Fixed at -106752 days +00:12:43.145224193 + max : Timedelta + Returns the maximum Timedelta value that can be created or used in + pandas operations. + Fixed at 106751 days 23:47:16.854775807. + See Also -------- Timestamp : Represents a single timestamp in time. diff --git a/pandas/core/frame.py b/pandas/core/frame.py index f47acf579d79c..e3ef6dd6f810c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2124,9 +2124,10 @@ def from_records( columns : sequence, default None Column names to use. If the passed data do not have names associated with them, this argument provides names for the - columns. Otherwise this argument indicates the order of the columns + columns. Otherwise, this argument indicates the order of the columns in the result (any names not found in the data will become all-NA - columns). + columns) and limits the data to these columns if not all column names + are provided. coerce_float : bool, default False Attempt to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point, useful for SQL result sets.