Skip to content

Commit

Permalink
Fix download(ignore_tz=True) for single ticker
Browse files Browse the repository at this point in the history
  • Loading branch information
ValueRaider committed Oct 22, 2022
1 parent 75c823a commit c6c0fa3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yfinance/multi.py
Expand Up @@ -139,15 +139,15 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_
print("\n".join(['- %s: %s' %
v for v in list(shared._ERRORS.items())]))

if len(tickers) == 1:
ticker = tickers[0]
return shared._DFS[shared._ISINS.get(ticker, ticker)]

if ignore_tz:
for tkr in shared._DFS.keys():
if (shared._DFS[tkr] is not None) and (shared._DFS[tkr].shape[0]>0):
shared._DFS[tkr].index = shared._DFS[tkr].index.tz_localize(None)

if len(tickers) == 1:
ticker = tickers[0]
return shared._DFS[shared._ISINS.get(ticker, ticker)]

try:
data = _pd.concat(shared._DFS.values(), axis=1, sort=True,
keys=shared._DFS.keys())
Expand Down

0 comments on commit c6c0fa3

Please sign in to comment.