Skip to content

Commit 5c38be7

Browse files
committed
COMPAT: suppress numpy warnings
1 parent 61d43c3 commit 5c38be7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pandas/core/internals/managers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,9 @@ def _compare_or_regex_search(a, b, regex=False):
19241924
is_a_array = isinstance(a, np.ndarray)
19251925
is_b_array = isinstance(b, np.ndarray)
19261926

1927-
result = op(a)
1927+
with np.errstate(all="ignore"):
1928+
# suppress FutureWarning about elementwise comparison
1929+
result = op(a)
19281930

19291931
if is_scalar(result) and (is_a_array or is_b_array):
19301932
type_names = [type(a).__name__, type(b).__name__]

pandas/core/missing.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def mask_missing(arr, values_to_mask):
3838
mask = None
3939
for x in nonna:
4040
if mask is None:
41-
mask = arr == x
41+
with np.errstate(all="ignore"):
42+
# suppress FutureWarning about elementwise comparison
43+
mask = arr == x
4244

4345
# if x is a string and arr is not, then we get False and we must
4446
# expand the mask to size arr.shape

0 commit comments

Comments
 (0)