Skip to content

Commit 6d66ae7

Browse files
authored
Merge pull request #591 from corakwue/patch-1
ENH: Bug fix for downloading index historicals.
2 parents 7949e60 + a27a67e commit 6d66ae7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pandas_datareader/stooq.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ def url(self):
3737

3838
def _get_params(self, symbol, country='US'):
3939
symbol_parts = symbol.split(".")
40-
if len(symbol_parts) == 1:
41-
symbol = ".".join([symbol, country])
42-
else:
43-
if symbol_parts[1].lower() not in ['de', 'hk', 'hu', 'jp',
44-
'pl', 'uk', 'us']:
45-
symbol = ".".join([symbol, 'US'])
40+
if not symbol.startswith('^'):
41+
if len(symbol_parts) == 1:
42+
symbol = ".".join([symbol, country])
43+
else:
44+
if symbol_parts[1].lower() not in ['de', 'hk', 'hu', 'jp',
45+
'pl', 'uk', 'us']:
46+
symbol = ".".join([symbol, 'US'])
4647

4748
params = {
4849
's': symbol,

0 commit comments

Comments
 (0)