Skip to content

Commit 3819261

Browse files
Kurt Forresterbashtage
authored andcommitted
PEP8 clean-up
1 parent 09fa753 commit 3819261

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

pandas_datareader/tests/test_wb.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def test_wdi_get_indicators(self):
216216
assert len(result) > 10000
217217

218218
def test_wdi_download_monthly(self):
219-
220219
expected = {'COPPER': {('World', '2012M01'): 8040.47,
221220
('World', '2011M12'): 7565.48,
222221
('World', '2011M11'): 7581.02,
@@ -251,12 +250,11 @@ def test_wdi_download_monthly(self):
251250
tm.assert_frame_equal(result, expected)
252251

253252
def test_wdi_download_quarterly(self):
254-
255253
expected = {'DT.DOD.PUBS.CD.US': {('Albania', '2012Q1'): 3240539817.18,
256254
('Albania', '2011Q4'): 3213979715.15,
257255
('Albania', '2011Q3'): 3187681048.95,
258256
('Albania', '2011Q2'): 3248041513.86,
259-
('Albania', '2011Q1'): 3137210567.92,}}
257+
('Albania', '2011Q1'): 3137210567.92}}
260258
expected = pd.DataFrame(expected)
261259
# Round, to ignore revisions to data.
262260
expected = np.round(expected, decimals=-3)

pandas_datareader/wb.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,12 @@ def __init__(self, symbols=None, countries=None,
144144
warnings.warn('Non-standard ISO '
145145
'country codes: %s' % tmp, UserWarning)
146146

147-
freq_symbols = ['M','Q','A', None]
147+
freq_symbols = ['M', 'Q', 'A', None]
148+
148149
if freq not in freq_symbols:
149150
msg = 'The frequency `{0}` is not in the accepted list.'.format(freq)
150151
raise ValueError(msg)
151-
152+
152153
self.freq = freq
153154
self.countries = countries
154155
self.errors = errors
@@ -168,7 +169,7 @@ def params(self):
168169
elif self.freq == 'Q':
169170
return {'date': '{0}Q{1}:{2}Q{3}'.format(self.start.year,
170171
self.start.quarter, self.end.year,
171-
self.end.quarter), 'per_page': 25000,
172+
self.end.quarter), 'per_page': 25000,
172173
'format': 'json'}
173174
else:
174175
return {'date': '{0}:{1}'.format(self.start.year, self.end.year),
@@ -372,10 +373,10 @@ def download(country=None, indicator=None, start=2003, end=2005, freq=None,
372373
373374
end: int
374375
Last year of the data series (inclusive)
375-
376+
376377
freq: str
377-
frequency or periodicity of the data to be retrieved (e.g. 'M' for
378-
monthly, 'Q' for quarterly, and 'A' for annual). None defaults to
378+
frequency or periodicity of the data to be retrieved (e.g. 'M' for
379+
monthly, 'Q' for quarterly, and 'A' for annual). None defaults to
379380
annual.
380381
381382
errors: str {'ignore', 'warn', 'raise'}, default 'warn'

0 commit comments

Comments
 (0)