Skip to content

Commit a3d353f

Browse files
author
VibavariG
committed
Merge remote-tracking branch 'upstream/main' into 59717-from-records-columns-reorder
2 parents b9e7af2 + 081dcde commit a3d353f

File tree

18 files changed

+150
-35
lines changed

18 files changed

+150
-35
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7070
--format=actions \
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
73-
-i "pandas.NA SA01" \
7473
-i "pandas.Period.freq GL08" \
7574
-i "pandas.Period.ordinal GL08" \
76-
-i "pandas.PeriodDtype.freq SA01" \
7775
-i "pandas.RangeIndex.from_range PR01,SA01" \
7876
-i "pandas.RangeIndex.step SA01" \
7977
-i "pandas.Series.cat.add_categories PR01,PR02" \
@@ -103,12 +101,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
103101
-i "pandas.Series.sparse.from_coo PR07,SA01" \
104102
-i "pandas.Series.sparse.npoints SA01" \
105103
-i "pandas.Series.sparse.sp_values SA01" \
106-
-i "pandas.Timedelta.components SA01" \
107104
-i "pandas.Timedelta.max PR02" \
108105
-i "pandas.Timedelta.min PR02" \
109106
-i "pandas.Timedelta.resolution PR02" \
110107
-i "pandas.Timedelta.to_timedelta64 SA01" \
111-
-i "pandas.Timedelta.total_seconds SA01" \
112108
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
113109
-i "pandas.Timestamp.max PR02" \
114110
-i "pandas.Timestamp.min PR02" \
@@ -117,14 +113,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
117113
-i "pandas.Timestamp.tzinfo GL08" \
118114
-i "pandas.Timestamp.year GL08" \
119115
-i "pandas.api.types.is_dict_like PR07,SA01" \
120-
-i "pandas.api.types.is_extension_array_dtype SA01" \
121116
-i "pandas.api.types.is_file_like PR07,SA01" \
122117
-i "pandas.api.types.is_float PR01,SA01" \
123118
-i "pandas.api.types.is_float_dtype SA01" \
124119
-i "pandas.api.types.is_hashable PR01,RT03,SA01" \
125120
-i "pandas.api.types.is_int64_dtype SA01" \
126121
-i "pandas.api.types.is_integer PR01,SA01" \
127-
-i "pandas.api.types.is_integer_dtype SA01" \
128122
-i "pandas.api.types.is_interval_dtype SA01" \
129123
-i "pandas.api.types.is_iterator PR07,SA01" \
130124
-i "pandas.api.types.is_list_like SA01" \
@@ -136,7 +130,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
136130
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
137131
-i "pandas.arrays.BooleanArray SA01" \
138132
-i "pandas.arrays.DatetimeArray SA01" \
139-
-i "pandas.arrays.FloatingArray SA01" \
140133
-i "pandas.arrays.IntegerArray SA01" \
141134
-i "pandas.arrays.IntervalArray.left SA01" \
142135
-i "pandas.arrays.IntervalArray.length SA01" \
@@ -198,7 +191,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
198191
-i "pandas.errors.IntCastingNaNError SA01" \
199192
-i "pandas.errors.InvalidIndexError SA01" \
200193
-i "pandas.errors.InvalidVersion SA01" \
201-
-i "pandas.errors.MergeError SA01" \
202194
-i "pandas.errors.NullFrequencyError SA01" \
203195
-i "pandas.errors.NumExprClobberingError SA01" \
204196
-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/missing.pyx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ class NAType(C_NAType):
347347
The NA singleton is a missing value indicator defined by pandas. It is
348348
used in certain new extension dtypes (currently the "string" dtype).
349349
350+
See Also
351+
--------
352+
numpy.nan : Floating point representation of Not a Number (NaN) for numerical data.
353+
isna : Detect missing values for an array-like object.
354+
notna : Detect non-missing values for an array-like object.
355+
DataFrame.fillna : Fill missing values in a DataFrame.
356+
Series.fillna : Fill missing values in a Series.
357+
350358
Examples
351359
--------
352360
>>> pd.NA

pandas/_libs/tslibs/nattype.pyx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,14 @@ 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+
499+
See Also
500+
--------
501+
to_timedelta : Convert argument to timedelta.
502+
Timedelta : Represents a duration, the difference between two dates or times.
503+
496504
Examples
497505
--------
498506
>>> td = pd.Timedelta('1min')

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,14 @@ 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+
1195+
See Also
1196+
--------
1197+
to_timedelta : Convert argument to timedelta.
1198+
Timedelta : Represents a duration, the difference between two dates or times.
1199+
11921200
Examples
11931201
--------
11941202
>>> td = pd.Timedelta('1min')
@@ -1493,6 +1501,17 @@ cdef class _Timedelta(timedelta):
14931501
"""
14941502
Return a components namedtuple-like.
14951503
1504+
Each component represents a different time unit, allowing you to access the
1505+
breakdown of the total duration in terms of days, hours, minutes, seconds,
1506+
milliseconds, microseconds, and nanoseconds.
1507+
1508+
See Also
1509+
--------
1510+
Timedelta.total_seconds : Returns the total duration of the Timedelta in
1511+
seconds.
1512+
to_timedelta : Convert argument to Timedelta.
1513+
Timedelta : Represents a duration, the difference between two dates or times.
1514+
14961515
Examples
14971516
--------
14981517
>>> 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

0 commit comments

Comments
 (0)