Skip to content

Commit

Permalink
Fix empty-df detection and date ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
ValueRaider committed Oct 18, 2022
1 parent ff42a3a commit 7902ec8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yfinance/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_

if ignore_tz:
for tkr in shared._DFS.keys():
if not shared._DFS[tkr] is None:
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)

try:
data = _pd.concat(shared._DFS.values(), axis=1,
data = _pd.concat(shared._DFS.values(), axis=1, sort=True,
keys=shared._DFS.keys())
except Exception:
_realign_dfs()
data = _pd.concat(shared._DFS.values(), axis=1,
data = _pd.concat(shared._DFS.values(), axis=1, sort=True,
keys=shared._DFS.keys())

# switch names back to isins if applicable
Expand Down

0 comments on commit 7902ec8

Please sign in to comment.