Skip to content

Commit 08e0e37

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 9496569 commit 08e0e37

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

pandas/core/arrays/boolean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _logical_method(self, other, op): # type: ignore[override]
379379
elif is_list_like(other):
380380
other = np.asarray(other, dtype="bool")
381381
if other.ndim > 1:
382-
return NotImplemented
382+
return NotImplemented
383383
other, mask = coerce_to_array(other, copy=False)
384384
elif isinstance(other, np.bool_):
385385
other = other.item()

pandas/tests/arithmetic/test_numeric.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,6 @@ def test_df_div_zero_series_does_not_commute(self):
564564
res2 = df / ser
565565
assert not res.fillna(0).equals(res2.fillna(0))
566566

567-
568-
569567
# ------------------------------------------------------------------
570568
# Mod By Zero
571569

@@ -857,35 +855,47 @@ def test_modulo_zero_int(self):
857855
result = 0 % s
858856
expected = Series([np.nan, 0.0])
859857
tm.assert_series_equal(result, expected)
860-
858+
861859
def test_np_array_mul_ea_array_returns_extensionarray():
862860
np_array = np.array([1, 2, 3, 4, 5], dtype=tm.SIGNED_INT_NUMPY_DTYPES[0])
863861
ea_array = pd.array([1, 2, 3, 4, 5], dtype=tm.SIGNED_INT_EA_DTYPES[0])
864862
result = np_array * ea_array
865863
tm.assert_isinstance(result, type(ea_array))
866-
tm.assert_equal(result, pd.array([1, 4, 9, 16, 25], dtype=tm.SIGNED_INT_EA_DTYPES[0]))
867-
tm.assert_equal(result, pd.array([1, 4, 9, 16, 25], dtype=tm.SIGNED_INT_EA_DTYPES[0]))
864+
tm.assert_equal(
865+
result, pd.array([1, 4, 9, 16, 25], dtype=tm.SIGNED_INT_EA_DTYPES[0])
866+
)
867+
tm.assert_equal(
868+
result, pd.array([1, 4, 9, 16, 25], dtype=tm.SIGNED_INT_EA_DTYPES[0])
869+
)
868870

869871
def test_df_mul_np_and_ea_array_shape_and_errors():
870872
df = pd.DataFrame(np.arange(50).reshape(10, 5)).notna().values
871-
NP_array = pd.array([i for i in range(10)], dtype=tm.SIGNED_INT_NUMPY_DTYPES[0]).reshape(10, 1)
872-
EA_array = pd.array([i for i in range(10)], dtype=tm.SIGNED_INT_EA_DTYPES[0]).reshape(10, 1)
873-
873+
NP_array = pd.array(
874+
[i for i in range(10)], dtype=tm.SIGNED_INT_NUMPY_DTYPES[0]
875+
).reshape(10, 1)
876+
EA_array = pd.array(
877+
[i for i in range(10)], dtype=tm.SIGNED_INT_EA_DTYPES[0]
878+
).reshape(10, 1)
879+
874880
result_np = df * NP_array
875881
tm.assert_isinstance(result_np, np.ndarray)
876882
tm.assert_equal(result_np.shape, (10, 5))
877883

878884
with tm.assert_raises(TypeError):
879-
_ = df * EA_array
885+
_ = df * EA_array
880886

881887
def test_non_1d_ea_raises_typeerror():
882-
ea_array = pd.array([1, 2, 3, 4, 5], dtype=tm.SIGNED_INT_EA_DTYPES[0]).reshape(5, 1)
883-
np_array = np.array([1, 2, 3, 4, 5], dtype=tm.SIGNED_INT_NUMPY_DTYPES[0]).reshape(5, 1)
888+
ea_array = pd.array([1, 2, 3, 4, 5], dtype=tm.SIGNED_INT_EA_DTYPES[0]).reshape(
889+
5, 1
890+
)
891+
np_array = np.array(
892+
[1, 2, 3, 4, 5], dtype=tm.SIGNED_INT_NUMPY_DTYPES[0]
893+
).reshape(5, 1)
884894

885895
with tm.assert_raises(TypeError):
886896
_ = ea_array * np_array
887897
with tm.assert_raises(TypeError):
888-
_ = np_array * ea_array
898+
_ = np_array * ea_array
889899

890900

891901
class TestAdditionSubtraction:

0 commit comments

Comments
 (0)