Skip to content

Commit 7902ec8

Browse files
committed
Fix empty-df detection and date ordering
1 parent ff42a3a commit 7902ec8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

yfinance/multi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ def download(tickers, start=None, end=None, actions=False, threads=True, ignore_
145145

146146
if ignore_tz:
147147
for tkr in shared._DFS.keys():
148-
if not shared._DFS[tkr] is None:
148+
if (shared._DFS[tkr] is not None) and (shared._DFS[tkr].shape[0]>0):
149149
shared._DFS[tkr].index = shared._DFS[tkr].index.tz_localize(None)
150150

151151
try:
152-
data = _pd.concat(shared._DFS.values(), axis=1,
152+
data = _pd.concat(shared._DFS.values(), axis=1, sort=True,
153153
keys=shared._DFS.keys())
154154
except Exception:
155155
_realign_dfs()
156-
data = _pd.concat(shared._DFS.values(), axis=1,
156+
data = _pd.concat(shared._DFS.values(), axis=1, sort=True,
157157
keys=shared._DFS.keys())
158158

159159
# switch names back to isins if applicable

0 commit comments

Comments
 (0)