Skip to content

Commit 797cde2

Browse files
committed
PEP8 fixes
1 parent b56b380 commit 797cde2

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pandas/io/excel.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from pandas.io.common import (_is_url, _urlopen, _validate_header_arg,
2222
get_filepath_or_buffer, _NA_VALUES,
2323
_stringify_path)
24-
from pandas.core.indexes.period import Period
24+
# from pandas.core.indexes.period import Period
2525
import pandas._libs.json as json
2626
from pandas.compat import (map, zip, reduce, range, lrange, u, add_metaclass,
2727
string_types, OrderedDict)
@@ -32,7 +32,6 @@
3232
from distutils.version import LooseVersion
3333
from pandas.util._decorators import Appender, deprecate_kwarg
3434
from textwrap import fill
35-
from pandas._libs.interval import Interval
3635

3736
__all__ = ["read_excel", "ExcelWriter", "ExcelFile"]
3837

@@ -1467,9 +1466,9 @@ def write_cells(self, cells, sheet_name=None, startrow=0, startcol=0,
14671466

14681467
if isinstance(cell.val, timedelta):
14691468
delta = cell.val
1470-
val = (delta.days + (float(delta.seconds)
1471-
+ float(delta.microseconds) / 1E6)
1472-
/ (60 * 60 * 24))
1469+
val = (delta.days + (float(delta.seconds) +
1470+
float(delta.microseconds) / 1E6) /
1471+
(60 * 60 * 24))
14731472

14741473
stylekey = json.dumps(cell.style)
14751474
if num_format_str:

pandas/tests/io/test_excel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,9 +1485,9 @@ def test_to_excel_timedelta(self):
14851485
delta = frame_expected['A'].apply(lambda x: timedelta(seconds=x))
14861486

14871487
def timedelta_rep(x):
1488-
return (x.days + (float(x.seconds)
1489-
+ float(x.microseconds) / 1E6)
1490-
/ (60 * 60 * 24))
1488+
return (x.days + (float(x.seconds) +
1489+
float(x.microseconds) / 1E6) /
1490+
(60 * 60 * 24))
14911491

14921492
frame_expected['new'] = delta.apply(timedelta_rep)
14931493
frame.to_excel(path, 'test1')

0 commit comments

Comments
 (0)