Skip to content

Commit e7e09db

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix-docstring
2 parents 4e6e36b + 8b1b211 commit e7e09db

File tree

20 files changed

+157
-34
lines changed

20 files changed

+157
-34
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
7373
-i "pandas.Period.freq GL08" \
7474
-i "pandas.Period.ordinal GL08" \
75-
-i "pandas.PeriodDtype.freq SA01" \
7675
-i "pandas.RangeIndex.from_range PR01,SA01" \
7776
-i "pandas.RangeIndex.step SA01" \
7877
-i "pandas.Series.cat.add_categories PR01,PR02" \
@@ -102,7 +101,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
102101
-i "pandas.Series.sparse.from_coo PR07,SA01" \
103102
-i "pandas.Series.sparse.npoints SA01" \
104103
-i "pandas.Series.sparse.sp_values SA01" \
105-
-i "pandas.Timedelta.components SA01" \
106104
-i "pandas.Timedelta.max PR02" \
107105
-i "pandas.Timedelta.min PR02" \
108106
-i "pandas.Timedelta.resolution PR02" \
@@ -114,14 +112,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
114112
-i "pandas.Timestamp.tzinfo GL08" \
115113
-i "pandas.Timestamp.year GL08" \
116114
-i "pandas.api.types.is_dict_like PR07,SA01" \
117-
-i "pandas.api.types.is_extension_array_dtype SA01" \
118115
-i "pandas.api.types.is_file_like PR07,SA01" \
119116
-i "pandas.api.types.is_float PR01,SA01" \
120117
-i "pandas.api.types.is_float_dtype SA01" \
121118
-i "pandas.api.types.is_hashable PR01,RT03,SA01" \
122119
-i "pandas.api.types.is_int64_dtype SA01" \
123120
-i "pandas.api.types.is_integer PR01,SA01" \
124-
-i "pandas.api.types.is_integer_dtype SA01" \
125121
-i "pandas.api.types.is_interval_dtype SA01" \
126122
-i "pandas.api.types.is_iterator PR07,SA01" \
127123
-i "pandas.api.types.is_list_like SA01" \
@@ -133,7 +129,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
133129
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
134130
-i "pandas.arrays.BooleanArray SA01" \
135131
-i "pandas.arrays.DatetimeArray SA01" \
136-
-i "pandas.arrays.FloatingArray SA01" \
137132
-i "pandas.arrays.IntegerArray SA01" \
138133
-i "pandas.arrays.IntervalArray.left SA01" \
139134
-i "pandas.arrays.IntervalArray.length SA01" \
@@ -195,7 +190,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
195190
-i "pandas.errors.IntCastingNaNError SA01" \
196191
-i "pandas.errors.InvalidIndexError SA01" \
197192
-i "pandas.errors.InvalidVersion SA01" \
198-
-i "pandas.errors.MergeError SA01" \
199193
-i "pandas.errors.NullFrequencyError SA01" \
200194
-i "pandas.errors.NumExprClobberingError SA01" \
201195
-i "pandas.errors.NumbaUtilError SA01" \

doc/source/whatsnew/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Version 2.2
3232
.. toctree::
3333
:maxdepth: 2
3434

35+
v2.2.3
3536
v2.2.2
3637
v2.2.1
3738
v2.2.0

doc/source/whatsnew/v2.2.3.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.. _whatsnew_223:
2+
3+
What's new in 2.2.3 (September XX, 2024)
4+
----------------------------------------
5+
6+
These are the changes in pandas 2.2.3. See :ref:`release` for a full changelog
7+
including other versions of pandas.
8+
9+
{{ header }}
10+
11+
.. ---------------------------------------------------------------------------
12+
.. _whatsnew_223.regressions:
13+
14+
Fixed regressions
15+
~~~~~~~~~~~~~~~~~
16+
-
17+
18+
.. ---------------------------------------------------------------------------
19+
.. _whatsnew_223.bug_fixes:
20+
21+
Bug fixes
22+
~~~~~~~~~
23+
-
24+
25+
.. ---------------------------------------------------------------------------
26+
.. _whatsnew_223.other:
27+
28+
Other
29+
~~~~~
30+
-
31+
32+
.. ---------------------------------------------------------------------------
33+
.. _whatsnew_223.contributors:
34+
35+
Contributors
36+
~~~~~~~~~~~~

pandas/_libs/tslibs/nattype.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,13 @@ class NaTType(_NaT):
493493
"""
494494
Total seconds in the duration.
495495
496+
This method calculates the total duration in seconds by combining
497+
the days, seconds, and microseconds of the `Timedelta` object.
498+
496499
See Also
497500
--------
501+
to_timedelta : Convert argument to timedelta.
502+
Timedelta : Represents a duration, the difference between two dates or times.
498503
Timedelta.seconds : Returns the seconds component of the timedelta.
499504
Timedelta.microseconds : Returns the microseconds component of the timedelta.
500505

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,13 @@ cdef class _Timedelta(timedelta):
11891189
"""
11901190
Total seconds in the duration.
11911191

1192+
This method calculates the total duration in seconds by combining
1193+
the days, seconds, and microseconds of the `Timedelta` object.
1194+
11921195
See Also
11931196
--------
1197+
to_timedelta : Convert argument to timedelta.
1198+
Timedelta : Represents a duration, the difference between two dates or times.
11941199
Timedelta.seconds : Returns the seconds component of the timedelta.
11951200
Timedelta.microseconds : Returns the microseconds component of the timedelta.
11961201

@@ -1507,6 +1512,17 @@ cdef class _Timedelta(timedelta):
15071512
"""
15081513
Return a components namedtuple-like.
15091514
1515+
Each component represents a different time unit, allowing you to access the
1516+
breakdown of the total duration in terms of days, hours, minutes, seconds,
1517+
milliseconds, microseconds, and nanoseconds.
1518+
1519+
See Also
1520+
--------
1521+
Timedelta.total_seconds : Returns the total duration of the Timedelta in
1522+
seconds.
1523+
to_timedelta : Convert argument to Timedelta.
1524+
Timedelta : Represents a duration, the difference between two dates or times.
1525+
15101526
Examples
15111527
--------
15121528
>>> td = pd.Timedelta('2 day 4 min 3 us 42 ns')

pandas/core/arrays/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,6 @@ def interpolate(
10101010
* 'time': Works on daily and higher resolution data to interpolate
10111011
given length of interval.
10121012
* 'index', 'values': use the actual numerical values of the index.
1013-
* 'pad': Fill in NaNs using existing values.
10141013
* 'nearest', 'zero', 'slinear', 'quadratic', 'cubic', 'barycentric',
10151014
'polynomial': Passed to scipy.interpolate.interp1d, whereas 'spline'
10161015
is passed to scipy.interpolate.UnivariateSpline. These methods use

pandas/core/arrays/floating.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ class FloatingArray(NumericArray):
9696
-------
9797
FloatingArray
9898
99+
See Also
100+
--------
101+
array : Create an array.
102+
Float32Dtype : Float32 dtype for FloatingArray.
103+
Float64Dtype : Float64 dtype for FloatingArray.
104+
Series : One-dimensional labeled array capable of holding data.
105+
DataFrame : Two-dimensional, size-mutable, potentially heterogeneous tabular data.
106+
99107
Examples
100108
--------
101109
Create an FloatingArray with :func:`pandas.array`:

pandas/core/computation/eval.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
from pandas.util._exceptions import find_stack_level
1515
from pandas.util._validators import validate_bool_kwarg
1616

17-
from pandas.core.dtypes.common import is_extension_array_dtype
17+
from pandas.core.dtypes.common import (
18+
is_extension_array_dtype,
19+
is_string_dtype,
20+
)
1821

1922
from pandas.core.computation.engines import ENGINES
2023
from pandas.core.computation.expr import (
@@ -345,10 +348,13 @@ def eval(
345348
parsed_expr = Expr(expr, engine=engine, parser=parser, env=env)
346349

347350
if engine == "numexpr" and (
348-
is_extension_array_dtype(parsed_expr.terms.return_type)
351+
(
352+
is_extension_array_dtype(parsed_expr.terms.return_type)
353+
and not is_string_dtype(parsed_expr.terms.return_type)
354+
)
349355
or getattr(parsed_expr.terms, "operand_types", None) is not None
350356
and any(
351-
is_extension_array_dtype(elem)
357+
(is_extension_array_dtype(elem) and not is_string_dtype(elem))
352358
for elem in parsed_expr.terms.operand_types
353359
)
354360
):

pandas/core/computation/expr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
from pandas.errors import UndefinedVariableError
2323

24+
from pandas.core.dtypes.common import is_string_dtype
25+
2426
import pandas.core.common as com
2527
from pandas.core.computation.ops import (
2628
ARITH_OPS_SYMS,
@@ -524,10 +526,12 @@ def _maybe_evaluate_binop(
524526
elif self.engine != "pytables":
525527
if (
526528
getattr(lhs, "return_type", None) == object
529+
or is_string_dtype(getattr(lhs, "return_type", None))
527530
or getattr(rhs, "return_type", None) == object
531+
or is_string_dtype(getattr(rhs, "return_type", None))
528532
):
529533
# evaluate "==" and "!=" in python if either of our operands
530-
# has an object return type
534+
# has an object or string return type
531535
return self._maybe_eval(res, eval_in_python + maybe_eval_in_python)
532536
return res
533537

pandas/core/dtypes/common.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,15 @@ def is_integer_dtype(arr_or_dtype) -> bool:
694694
Whether or not the array or dtype is of an integer dtype and
695695
not an instance of timedelta64.
696696
697+
See Also
698+
--------
699+
api.types.is_integer : Return True if given object is integer.
700+
api.types.is_numeric_dtype : Check whether the provided array or dtype is of a
701+
numeric dtype.
702+
api.types.is_float_dtype : Check whether the provided array or dtype is of a
703+
float dtype.
704+
Int64Dtype : An ExtensionDtype for Int64Dtype integer data.
705+
697706
Examples
698707
--------
699708
>>> from pandas.api.types import is_integer_dtype
@@ -1401,6 +1410,10 @@ def is_extension_array_dtype(arr_or_dtype) -> bool:
14011410
bool
14021411
Whether the `arr_or_dtype` is an extension array type.
14031412
1413+
See Also
1414+
--------
1415+
api.extensions.ExtensionArray : Abstract base class for pandas extension arrays.
1416+
14041417
Notes
14051418
-----
14061419
This checks whether an object implements the pandas extension

0 commit comments

Comments
 (0)