Skip to content

Commit

Permalink
removing trailing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarthak authored and Sarthak committed Sep 3, 2020
1 parent 497ede8 commit da27715
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
4 changes: 1 addition & 3 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -2349,9 +2349,7 @@ def date_format(dt):


def format_query(sql, *args):
"""
"""
""""""
processed_args = []
for arg in args:
if isinstance(arg, float) and isna(arg):
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/io/test_stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ def test_read_chunks_117(
from_frame = parsed.iloc[pos : pos + chunksize, :].copy()
from_frame = self._convert_categorical(from_frame)
tm.assert_frame_equal(
from_frame, chunk, check_dtype=False, check_datetimelike_compat=True,
from_frame, chunk, check_dtype=False, check_datetimelike_compat=True
)

pos += chunksize
Expand Down Expand Up @@ -1251,7 +1251,7 @@ def test_read_chunks_115(
from_frame = parsed.iloc[pos : pos + chunksize, :].copy()
from_frame = self._convert_categorical(from_frame)
tm.assert_frame_equal(
from_frame, chunk, check_dtype=False, check_datetimelike_compat=True,
from_frame, chunk, check_dtype=False, check_datetimelike_compat=True
)

pos += chunksize
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ def test_scatter_with_c_column_name_with_colors(self, cmap):

def test_plot_scatter_with_s(self):
# this refers to GH 32904
df = DataFrame(np.random.random((10, 3)) * 100, columns=["a", "b", "c"],)
df = DataFrame(np.random.random((10, 3)) * 100, columns=["a", "b", "c"])

ax = df.plot.scatter(x="a", y="b", s="c")
tm.assert_numpy_array_equal(df["c"].values, right=ax.collections[0].get_sizes())
Expand Down Expand Up @@ -1716,7 +1716,7 @@ def test_hist_df(self):
def test_hist_weights(self, weights):
# GH 33173
np.random.seed(0)
df = pd.DataFrame(dict(zip(["A", "B"], np.random.randn(2, 100,))))
df = pd.DataFrame(dict(zip(["A", "B"], np.random.randn(2, 100))))

ax1 = _check_plot_works(df.plot, kind="hist", weights=weights)
ax2 = _check_plot_works(df.plot, kind="hist")
Expand Down
10 changes: 4 additions & 6 deletions pandas/tests/resample/test_datetime_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_resample_integerarray():

result = ts.resample("3T").mean()
expected = Series(
[1, 4, 7], index=pd.date_range("1/1/2000", periods=3, freq="3T"), dtype="Int64",
[1, 4, 7], index=pd.date_range("1/1/2000", periods=3, freq="3T"), dtype="Int64"
)
tm.assert_series_equal(result, expected)

Expand Down Expand Up @@ -764,7 +764,7 @@ def test_resample_origin():


@pytest.mark.parametrize(
"origin", ["invalid_value", "epch", "startday", "startt", "2000-30-30", object()],
"origin", ["invalid_value", "epch", "startday", "startt", "2000-30-30", object()]
)
def test_resample_bad_origin(origin):
rng = date_range("2000-01-01 00:00:00", "2000-01-01 02:00", freq="s")
Expand All @@ -777,9 +777,7 @@ def test_resample_bad_origin(origin):
ts.resample("5min", origin=origin)


@pytest.mark.parametrize(
"offset", ["invalid_value", "12dayys", "2000-30-30", object()],
)
@pytest.mark.parametrize("offset", ["invalid_value", "12dayys", "2000-30-30", object()])
def test_resample_bad_offset(offset):
rng = date_range("2000-01-01 00:00:00", "2000-01-01 02:00", freq="s")
ts = Series(np.random.randn(len(rng)), index=rng)
Expand Down Expand Up @@ -1595,7 +1593,7 @@ def test_downsample_dst_at_midnight():
"America/Havana", ambiguous=True
)
dti = pd.DatetimeIndex(dti, freq="D")
expected = DataFrame([7.5, 28.0, 44.5], index=dti,)
expected = DataFrame([7.5, 28.0, 44.5], index=dti)
tm.assert_frame_equal(result, expected)


Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/reshape/merge/test_merge_index_as_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def df2():

@pytest.fixture(params=[[], ["outer"], ["outer", "inner"]])
def left_df(request, df1):
""" Construct left test DataFrame with specified levels
"""Construct left test DataFrame with specified levels
(any of 'outer', 'inner', and 'v1')
"""
levels = request.param
Expand All @@ -41,7 +41,7 @@ def left_df(request, df1):

@pytest.fixture(params=[[], ["outer"], ["outer", "inner"]])
def right_df(request, df2):
""" Construct right test DataFrame with specified levels
"""Construct right test DataFrame with specified levels
(any of 'outer', 'inner', and 'v2')
"""
levels = request.param
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/reshape/test_crosstab.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def test_crosstab_normalize(self):
crosstab(df.a, df.b, normalize="columns"),
)
tm.assert_frame_equal(
crosstab(df.a, df.b, normalize=0), crosstab(df.a, df.b, normalize="index"),
crosstab(df.a, df.b, normalize=0), crosstab(df.a, df.b, normalize="index")
)

row_normal_margins = DataFrame(
Expand All @@ -377,7 +377,7 @@ def test_crosstab_normalize(self):
crosstab(df.a, df.b, normalize="index", margins=True), row_normal_margins
)
tm.assert_frame_equal(
crosstab(df.a, df.b, normalize="columns", margins=True), col_normal_margins,
crosstab(df.a, df.b, normalize="columns", margins=True), col_normal_margins
)
tm.assert_frame_equal(
crosstab(df.a, df.b, normalize=True, margins=True), all_normal_margins
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/reshape/test_get_dummies.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_get_dummies_unicode(self, sparse):
s = [e, eacute, eacute]
res = get_dummies(s, prefix="letter", sparse=sparse)
exp = DataFrame(
{"letter_e": [1, 0, 0], f"letter_{eacute}": [0, 1, 1]}, dtype=np.uint8,
{"letter_e": [1, 0, 0], f"letter_{eacute}": [0, 1, 1]}, dtype=np.uint8
)
if sparse:
exp = exp.apply(SparseArray, fill_value=0)
Expand Down

0 comments on commit da27715

Please sign in to comment.