Skip to content

Commit bc69338

Browse files
Merge remote-tracking branch 'upstream/main' into cow-doc-series-copy
2 parents 17389bf + 04a554c commit bc69338

File tree

21 files changed

+149
-102
lines changed

21 files changed

+149
-102
lines changed

doc/source/user_guide/timeseries.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,15 +1294,6 @@ frequencies. We will refer to these aliases as *offset aliases*.
12941294
"us", "microseconds"
12951295
"ns", "nanoseconds"
12961296

1297-
.. deprecated:: 2.2.0
1298-
1299-
Aliases ``H``, ``BH``, ``CBH``, ``T``, ``S``, ``L``, ``U``, and ``N``
1300-
are deprecated in favour of the aliases ``h``, ``bh``, ``cbh``,
1301-
``min``, ``s``, ``ms``, ``us``, and ``ns``.
1302-
1303-
Aliases ``Y``, ``M``, and ``Q`` are deprecated in favour of the aliases
1304-
``YE``, ``ME``, ``QE``.
1305-
13061297

13071298
.. note::
13081299

@@ -1358,11 +1349,6 @@ frequencies. We will refer to these aliases as *period aliases*.
13581349
"us", "microseconds"
13591350
"ns", "nanoseconds"
13601351

1361-
.. deprecated:: 2.2.0
1362-
1363-
Aliases ``H``, ``T``, ``S``, ``L``, ``U``, and ``N`` are deprecated in favour of the aliases
1364-
``h``, ``min``, ``s``, ``ms``, ``us``, and ``ns``.
1365-
13661352

13671353
Combining aliases
13681354
~~~~~~~~~~~~~~~~~

pandas/core/algorithms.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,14 +1140,8 @@ def take(
11401140
11411141
Parameters
11421142
----------
1143-
arr : array-like or scalar value
1144-
Non array-likes (sequences/scalars without a dtype) are coerced
1145-
to an ndarray.
1146-
1147-
.. deprecated:: 2.1.0
1148-
Passing an argument other than a numpy.ndarray, ExtensionArray,
1149-
Index, or Series is deprecated.
1150-
1143+
arr : numpy.ndarray, ExtensionArray, Index, or Series
1144+
Input array.
11511145
indices : sequence of int or one-dimensional np.ndarray of int
11521146
Indices to be taken.
11531147
axis : int, default 0

pandas/core/col.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
"__lt__": "<",
3838
"__eq__": "==",
3939
"__ne__": "!=",
40+
"__and__": "&",
41+
"__rand__": "&",
42+
"__or__": "|",
43+
"__ror__": "|",
44+
"__xor__": "^",
45+
"__rxor__": "^",
4046
}
4147

4248

@@ -157,6 +163,28 @@ def __mod__(self, other: Any) -> Expression:
157163
def __rmod__(self, other: Any) -> Expression:
158164
return self._with_binary_op("__rmod__", other)
159165

166+
# Logical ops
167+
def __and__(self, other: Any) -> Expression:
168+
return self._with_binary_op("__and__", other)
169+
170+
def __rand__(self, other: Any) -> Expression:
171+
return self._with_binary_op("__rand__", other)
172+
173+
def __or__(self, other: Any) -> Expression:
174+
return self._with_binary_op("__or__", other)
175+
176+
def __ror__(self, other: Any) -> Expression:
177+
return self._with_binary_op("__ror__", other)
178+
179+
def __xor__(self, other: Any) -> Expression:
180+
return self._with_binary_op("__xor__", other)
181+
182+
def __rxor__(self, other: Any) -> Expression:
183+
return self._with_binary_op("__rxor__", other)
184+
185+
def __invert__(self) -> Expression:
186+
return Expression(lambda df: ~self(df), f"(~{self._repr_str})")
187+
160188
def __array_ufunc__(
161189
self, ufunc: Callable[..., Any], method: str, *inputs: Any, **kwargs: Any
162190
) -> Expression:

pandas/core/config_init.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def is_terminal() -> bool:
423423
# to False. This environment variable can be set for testing.
424424
"warn"
425425
if os.environ.get("PANDAS_COPY_ON_WRITE", "0") == "warn"
426-
else os.environ.get("PANDAS_COPY_ON_WRITE", "0") == "1",
426+
else os.environ.get("PANDAS_COPY_ON_WRITE", "1") == "1",
427427
copy_on_write_doc,
428428
validator=is_one_of_factory([True, False, "warn"]),
429429
)
@@ -908,7 +908,8 @@ def register_converter_cb(key: str) -> None:
908908
"mode.copy_on_write",
909909
Pandas4Warning,
910910
msg=(
911-
"Copy-on-Write can no longer be disabled, setting to False has no impact. "
912-
"This option will be removed in pandas 4.0."
911+
"The 'mode.copy_on_write' option is deprecated. Copy-on-Write can no longer "
912+
"be disabled (it is always enabled with pandas >= 3.0), and setting the option "
913+
"has no impact. This option will be removed in pandas 4.0."
913914
),
914915
)

pandas/core/generic.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10965,10 +10965,6 @@ def pct_change(
1096510965
Periods to shift for forming percent change.
1096610966
fill_method : None
1096710967
Must be None. This argument will be removed in a future version of pandas.
10968-
10969-
.. deprecated:: 2.1
10970-
All options of `fill_method` are deprecated except `fill_method=None`.
10971-
1097210968
freq : DateOffset, timedelta, or str, optional
1097310969
Increment to use from time series API (e.g. 'ME' or BDay()).
1097410970
**kwargs

pandas/core/groupby/generic.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs)
375375
376376
Parameters
377377
----------
378-
func : function, str, list, dict or None
378+
func : function, str, list or None
379379
Function to use for aggregating the data. If a function, must either
380380
work when passed a Series or when passed to Series.apply.
381381
@@ -399,10 +399,6 @@ def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs)
399399
Each group's index will be passed to the user defined function
400400
and optionally available for use.
401401
402-
.. deprecated:: 2.1.0
403-
404-
Passing a dictionary is deprecated and will raise in a future version
405-
of pandas. Pass a list of aggregations instead.
406402
*args
407403
Positional arguments to pass to func.
408404
engine : str, default None

pandas/core/groupby/groupby.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5366,9 +5366,6 @@ def pct_change(
53665366
fill_method : None
53675367
Must be None. This argument will be removed in a future version of pandas.
53685368
5369-
.. deprecated:: 2.1
5370-
All options of `fill_method` are deprecated except `fill_method=None`.
5371-
53725369
freq : str, pandas offset object, or None, default None
53735370
The frequency increment for time series data (e.g., 'M' for month-end).
53745371
If None, the frequency is inferred from the index. Relevant for time

pandas/core/tools/timedeltas.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,15 @@ def to_timedelta(
113113
114114
* 'W'
115115
* 'D' / 'days' / 'day'
116-
* 'hours' / 'hour' / 'hr' / 'h' / 'H'
116+
* 'hours' / 'hour' / 'hr' / 'h'
117117
* 'm' / 'minute' / 'min' / 'minutes'
118-
* 's' / 'seconds' / 'sec' / 'second' / 'S'
118+
* 's' / 'seconds' / 'sec' / 'second'
119119
* 'ms' / 'milliseconds' / 'millisecond' / 'milli' / 'millis'
120120
* 'us' / 'microseconds' / 'microsecond' / 'micro' / 'micros'
121121
* 'ns' / 'nanoseconds' / 'nano' / 'nanos' / 'nanosecond'
122122
123123
Must not be specified when `arg` contains strings and ``errors="raise"``.
124124
125-
.. deprecated:: 2.2.0
126-
Units 'H'and 'S' are deprecated and will be removed
127-
in a future version. Please use 'h' and 's'.
128-
129125
errors : {'raise', 'coerce'}, default 'raise'
130126
- If 'raise', then invalid parsing will raise an exception.
131127
- If 'coerce', then invalid parsing will be set as NaT.

pandas/core/window/expanding.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,6 @@ def quantile(
10781078
q : float
10791079
Quantile to compute. 0 <= quantile <= 1.
10801080
1081-
.. deprecated:: 2.1.0
1082-
This was renamed from 'quantile' to 'q' in version 2.1.0.
10831081
interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
10841082
This optional parameter specifies the interpolation method to use,
10851083
when the desired quantile lies between two data points `i` and `j`:

pandas/core/window/rolling.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,9 +3088,6 @@ def quantile(
30883088
q : float
30893089
Quantile to compute. 0 <= quantile <= 1.
30903090
3091-
.. deprecated:: 2.1.0
3092-
This was renamed from 'quantile' to 'q' in version 2.1.0.
3093-
30943091
interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
30953092
This optional parameter specifies the interpolation method to use,
30963093
when the desired quantile lies between two data points `i` and `j`:

0 commit comments

Comments
 (0)