Skip to content

Commit 56db430

Browse files
committed
TST: remove some moar warnings
TST: parametrize stata tests
1 parent 76d1744 commit 56db430

File tree

3 files changed

+180
-182
lines changed

3 files changed

+180
-182
lines changed

pandas/core/dtypes/missing.py

+1-19
Original file line numberDiff line numberDiff line change
@@ -327,25 +327,7 @@ def array_equivalent(left, right, strict_nan=False):
327327
left = left.view('i8')
328328
right = right.view('i8')
329329

330-
# NaNs cannot occur otherwise.
331-
try:
332-
return np.array_equal(left, right)
333-
except AttributeError:
334-
# see gh-13388
335-
#
336-
# NumPy v1.7.1 has a bug in its array_equal
337-
# function that prevents it from correctly
338-
# comparing two arrays with complex dtypes.
339-
# This bug is corrected in v1.8.0, so remove
340-
# this try-except block as soon as we stop
341-
# supporting NumPy versions < 1.8.0
342-
if not is_dtype_equal(left.dtype, right.dtype):
343-
return False
344-
345-
left = left.tolist()
346-
right = right.tolist()
347-
348-
return left == right
330+
return np.array_equal(left, right)
349331

350332

351333
def _infer_fill_value(val):

pandas/core/internals.py

+9
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,15 @@ def get_result(other):
12891289
elif is_numeric_v_string_like(values, other):
12901290
result = False
12911291

1292+
# avoid numpy warning of elementwise comparisons
1293+
elif func.__name__ == 'eq':
1294+
if is_list_like(other) and not isinstance(other, np.ndarray):
1295+
other = np.asarray(other)
1296+
1297+
# if we can broadcast, then ok
1298+
if values.shape[-1] != other.shape[-1]:
1299+
return False
1300+
result = func(values, other)
12921301
else:
12931302
result = func(values, other)
12941303

0 commit comments

Comments
 (0)