Skip to content

Commit fa021bf

Browse files
committed
pep8 style fixes
1 parent 0c0ca34 commit fa021bf

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

pandas/tseries/resample.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,12 @@ def _apply_loffset(self, result):
382382
if isinstance(loffset, compat.string_types):
383383
loffset = to_offset(self.loffset)
384384

385-
if isinstance(loffset, (DateOffset, timedelta)) and \
386-
isinstance(result.index, DatetimeIndex) and \
387-
len(result.index) > 0:
385+
needs_offset = (
386+
isinstance(loffset, (DateOffset, timedelta)) and
387+
isinstance(result.index, DatetimeIndex) and
388+
len(result.index) > 0
389+
)
390+
if needs_offset:
388391
result.index = result.index + loffset
389392

390393
return result

pandas/tseries/tests/test_resample.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,10 @@ def test_resample_loffset_count(self):
945945

946946
result = ts.resample('10S', loffset='1s').count()
947947

948-
expected_index = date_range(start_time, periods=10, freq='10S') + timedelta(seconds=1)
948+
expected_index = (
949+
date_range(start_time, periods=10, freq='10S') +
950+
timedelta(seconds=1)
951+
)
949952
expected = pd.Series(10, index=expected_index)
950953

951954
assert_series_equal(result, expected)

0 commit comments

Comments
 (0)