Skip to content

Issue35925 remove more trailing commas #35959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,12 @@ def _get_values_tuple(self, key):
# If key is contained, would have returned by now
indexer, new_index = self.index.get_loc_level(key)
return self._constructor(self._values[indexer], index=new_index).__finalize__(
self,
self
)

def _get_values(self, indexer):
try:
return self._constructor(self._mgr.get_slice(indexer)).__finalize__(self,)
return self._constructor(self._mgr.get_slice(indexer)).__finalize__(self)
except ValueError:
# mpl compat if we look up e.g. ser[:, np.newaxis];
# see tests.series.timeseries.test_mpl_compat_hack
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/window/ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def var(self, bias: bool = False, *args, **kwargs):

def f(arg):
return window_aggregations.ewmcov(
arg, arg, self.com, self.adjust, self.ignore_na, self.min_periods, bias,
arg, arg, self.com, self.adjust, self.ignore_na, self.min_periods, bias
)

return self._apply(f)
Expand Down Expand Up @@ -458,7 +458,7 @@ def _get_corr(X, Y):

def _cov(x, y):
return window_aggregations.ewmcov(
x, y, self.com, self.adjust, self.ignore_na, self.min_periods, 1,
x, y, self.com, self.adjust, self.ignore_na, self.min_periods, 1
)

x_values = X._prep_values()
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/window/indexers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BaseIndexer:
"""Base class for window bounds calculations."""

def __init__(
self, index_array: Optional[np.ndarray] = None, window_size: int = 0, **kwargs,
self, index_array: Optional[np.ndarray] = None, window_size: int = 0, **kwargs
):
"""
Parameters
Expand Down Expand Up @@ -105,7 +105,7 @@ def get_window_bounds(
) -> Tuple[np.ndarray, np.ndarray]:

return calculate_variable_window_bounds(
num_values, self.window_size, min_periods, center, closed, self.index_array,
num_values, self.window_size, min_periods, center, closed, self.index_array
)


Expand Down Expand Up @@ -316,7 +316,7 @@ def get_window_bounds(
# Cannot use groupby_indicies as they might not be monotonic with the object
# we're rolling over
window_indicies = np.arange(
window_indicies_start, window_indicies_start + len(indices),
window_indicies_start, window_indicies_start + len(indices)
)
window_indicies_start += len(indices)
# Extend as we'll be slicing window like [start, end)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window/numba_.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def generate_numba_apply_func(

@numba.jit(nopython=nopython, nogil=nogil, parallel=parallel)
def roll_apply(
values: np.ndarray, begin: np.ndarray, end: np.ndarray, minimum_periods: int,
values: np.ndarray, begin: np.ndarray, end: np.ndarray, minimum_periods: int
) -> np.ndarray:
result = np.empty(len(begin))
for i in loop_range(len(result)):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,7 @@ def count(self):
@Substitution(name="rolling")
@Appender(_shared_docs["apply"])
def apply(
self, func, raw=False, engine=None, engine_kwargs=None, args=None, kwargs=None,
self, func, raw=False, engine=None, engine_kwargs=None, args=None, kwargs=None
):
return super().apply(
func,
Expand Down
9 changes: 2 additions & 7 deletions pandas/io/formats/css.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def expand(self, prop, value: str):
try:
mapping = self.SIDE_SHORTHANDS[len(tokens)]
except KeyError:
warnings.warn(
f'Could not expand "{prop}: {value}"', CSSWarning,
)
warnings.warn(f'Could not expand "{prop}: {value}"', CSSWarning)
return
for key, idx in zip(self.SIDES, mapping):
yield prop_fmt.format(key), tokens[idx]
Expand Down Expand Up @@ -117,10 +115,7 @@ def __call__(self, declarations_str, inherited=None):
props[prop] = self.size_to_pt(
props[prop], em_pt=font_size, conversions=self.BORDER_WIDTH_RATIOS
)
for prop in [
f"margin-{side}",
f"padding-{side}",
]:
for prop in [f"margin-{side}", f"padding-{side}"]:
if prop in props:
# TODO: support %
props[prop] = self.size_to_pt(
Expand Down
6 changes: 3 additions & 3 deletions pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
FloatFormatType = Union[str, Callable, "EngFormatter"]
ColspaceType = Mapping[Label, Union[str, int]]
ColspaceArgType = Union[
str, int, Sequence[Union[str, int]], Mapping[Label, Union[str, int]],
str, int, Sequence[Union[str, int]], Mapping[Label, Union[str, int]]
]

common_docstring = """
Expand Down Expand Up @@ -741,7 +741,7 @@ def _to_str_columns(self) -> List[List[str]]:
for i, c in enumerate(frame):
fmt_values = self._format_col(i)
fmt_values = _make_fixed_width(
fmt_values, self.justify, minimum=col_space.get(c, 0), adj=self.adj,
fmt_values, self.justify, minimum=col_space.get(c, 0), adj=self.adj
)
stringified.append(fmt_values)
else:
Expand Down Expand Up @@ -1069,7 +1069,7 @@ def _get_formatted_index(self, frame: "DataFrame") -> List[str]:
fmt_index = [
tuple(
_make_fixed_width(
list(x), justify="left", minimum=col_space.get("", 0), adj=self.adj,
list(x), justify="left", minimum=col_space.get("", 0), adj=self.adj
)
)
for x in fmt_index
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/orc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def read_orc(
path: FilePathOrBuffer, columns: Optional[List[str]] = None, **kwargs,
path: FilePathOrBuffer, columns: Optional[List[str]] = None, **kwargs
) -> "DataFrame":
"""
Load an ORC object from the file path, returning a DataFrame.
Expand Down