Skip to content

Commit

Permalink
cleared commas (#36073)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarthak <[email protected]>
  • Loading branch information
Sarthak Vineet Kumar and Sarthak authored Sep 2, 2020
1 parent f635d17 commit 00483a1
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 21 deletions.
10 changes: 3 additions & 7 deletions pandas/tests/scalar/test_na_scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_pow_special(value, asarray):


@pytest.mark.parametrize(
"value", [1, 1.0, True, np.bool_(True), np.int_(1), np.float_(1)],
"value", [1, 1.0, True, np.bool_(True), np.int_(1), np.float_(1)]
)
@pytest.mark.parametrize("asarray", [True, False])
def test_rpow_special(value, asarray):
Expand All @@ -128,9 +128,7 @@ def test_rpow_special(value, asarray):
assert result == value


@pytest.mark.parametrize(
"value", [-1, -1.0, np.int_(-1), np.float_(-1)],
)
@pytest.mark.parametrize("value", [-1, -1.0, np.int_(-1), np.float_(-1)])
@pytest.mark.parametrize("asarray", [True, False])
def test_rpow_minus_one(value, asarray):
if asarray:
Expand Down Expand Up @@ -193,9 +191,7 @@ def test_logical_not():
assert ~NA is NA


@pytest.mark.parametrize(
"shape", [(3,), (3, 3), (1, 2, 3)],
)
@pytest.mark.parametrize("shape", [(3,), (3, 3), (1, 2, 3)])
def test_arithmetic_ndarray(shape, all_arithmetic_functions):
op = all_arithmetic_functions
a = np.zeros(shape)
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/scalar/timestamp/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def test_add_int_with_freq(self, ts, other):
with pytest.raises(TypeError, match=msg):
other - ts

@pytest.mark.parametrize("shape", [(6,), (2, 3,)])
@pytest.mark.parametrize("shape", [(6,), (2, 3)])
def test_addsub_m8ndarray(self, shape):
# GH#33296
ts = Timestamp("2020-04-04 15:45")
Expand All @@ -237,7 +237,7 @@ def test_addsub_m8ndarray(self, shape):
with pytest.raises(TypeError, match=msg):
other - ts

@pytest.mark.parametrize("shape", [(6,), (2, 3,)])
@pytest.mark.parametrize("shape", [(6,), (2, 3)])
def test_addsub_m8ndarray_tzaware(self, shape):
# GH#33296
ts = Timestamp("2020-04-04 15:45", tz="US/Pacific")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/methods/test_argsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TestSeriesArgsort:
def _check_accum_op(self, name, ser, check_dtype=True):
func = getattr(np, name)
tm.assert_numpy_array_equal(
func(ser).values, func(np.array(ser)), check_dtype=check_dtype,
func(ser).values, func(np.array(ser)), check_dtype=check_dtype
)

# with missing values
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/series/methods/test_convert_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ class TestSeriesConvertDtypes:
pd.to_datetime(["2020-01-14 10:00", "2020-01-15 11:11"]),
object,
{
((True,), (True, False), (True, False), (True, False),): np.dtype(
((True,), (True, False), (True, False), (True, False)): np.dtype(
"datetime64[ns]"
),
((False,), (True, False), (True, False), (True, False),): np.dtype(
((False,), (True, False), (True, False), (True, False)): np.dtype(
"O"
),
},
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/methods/test_drop_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_drop_duplicates_categorical_non_bool(self, dtype, ordered):
def test_drop_duplicates_categorical_bool(self, ordered):
tc = Series(
Categorical(
[True, False, True, False], categories=[True, False], ordered=ordered,
[True, False, True, False], categories=[True, False], ordered=ordered
)
)

Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/series/methods/test_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
]
)
def nontemporal_method(request):
""" Fixture that returns an (method name, required kwargs) pair.
"""Fixture that returns an (method name, required kwargs) pair.
This fixture does not include method 'time' as a parameterization; that
method requires a Series with a DatetimeIndex, and is generally tested
Expand Down Expand Up @@ -60,7 +60,7 @@ def nontemporal_method(request):
]
)
def interp_methods_ind(request):
""" Fixture that returns a (method name, required kwargs) pair to
"""Fixture that returns a (method name, required kwargs) pair to
be tested for various Index types.
This fixture does not include methods - 'time', 'index', 'nearest',
Expand Down
6 changes: 2 additions & 4 deletions pandas/tests/series/methods/test_unstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ def test_unstack_tuplename_in_multiindex():

expected = pd.DataFrame(
[[1, 1, 1], [1, 1, 1], [1, 1, 1]],
columns=pd.MultiIndex.from_tuples(
[("a",), ("b",), ("c",)], names=[("A", "a")],
),
columns=pd.MultiIndex.from_tuples([("a",), ("b",), ("c",)], names=[("A", "a")]),
index=pd.Index([1, 2, 3], name=("B", "b")),
)
tm.assert_frame_equal(result, expected)
Expand Down Expand Up @@ -115,7 +113,7 @@ def test_unstack_mixed_type_name_in_multiindex(
result = ser.unstack(unstack_idx)

expected = pd.DataFrame(
expected_values, columns=expected_columns, index=expected_index,
expected_values, columns=expected_columns, index=expected_index
)
tm.assert_frame_equal(result, expected)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_cumulative.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def _check_accum_op(name, series, check_dtype=True):
func = getattr(np, name)
tm.assert_numpy_array_equal(
func(series).values, func(np.array(series)), check_dtype=check_dtype,
func(series).values, func(np.array(series)), check_dtype=check_dtype
)

# with missing values
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ def test_isin_int_df_string_search(self):
@pytest.mark.xfail(reason="problem related with issue #34125")
def test_isin_nan_df_string_search(self):
"""Comparing df with nan value (np.nan,2) with a string at isin() ("NaN")
-> should not match values because np.nan is not equal str NaN """
-> should not match values because np.nan is not equal str NaN"""
df = pd.DataFrame({"values": [np.nan, 2]})
result = df.isin(["NaN"])
expected_false = pd.DataFrame({"values": [False, False]})
Expand Down

0 comments on commit 00483a1

Please sign in to comment.