We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Issues with Date field
This issue appeared in version 0.1.77. I did no other package or python version updates since then.

Following script used to work on the date field:
`df[df.Date > '2020-01-01']`

But I am now getting following error message: TypeError: '>' not supported between instances of 'Timestamp' and 'str'

When I solve that issue by converting the string to a date (pd.to_datetime), I am getting other issues like: ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True

Somewhat further in my script, there is a pd.merge function based on the Date field received from yfinance. It gives now following error: Cannot compare between dtype('<M8[ns]') and dtype('0')

So I guess something has changed with how the dates are passed through. If yes, do you know how I can strip the received date from all these tz related stuff and just use it as a datetime64? I tried things like .dt.normalize() or .dt.date, but it always seems to give errors. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `yfinance/multi.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # yfinance - market data downloader
5 # https://github.com/ranaroussi/yfinance
6 #
7 # Copyright 2017-2019 Ran Aroussi
8 #
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
12 #
13 #     http://www.apache.org/licenses/LICENSE-2.0
14 #
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 #
21 
22 from __future__ import print_function
23 
24 import time as _time
25 import multitasking as _multitasking
26 import pandas as _pd
27 
28 from . import Ticker, utils
29 from . import shared
30 
31 
32 def download(tickers, start=None, end=None, actions=False, threads=True,
33              group_by='column', auto_adjust=False, back_adjust=False, keepna=False,
34              progress=True, period="max", show_errors=True, interval="1d", prepost=False,
35              proxy=None, rounding=False, timeout=None, **kwargs):
36     """Download yahoo tickers
37     :Parameters:
38         tickers : str, list
39             List of tickers to download
40         period : str
41             Valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
42             Either Use period parameter or use start and end
43         interval : str
44             Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
45             Intraday data cannot extend last 60 days
46         start: str
47             Download start date string (YYYY-MM-DD) or _datetime.
48             Default is 1900-01-01
49         end: str
50             Download end date string (YYYY-MM-DD) or _datetime.
51             Default is now
52         group_by : str
53             Group by 'ticker' or 'column' (default)
54         prepost : bool
55             Include Pre and Post market data in results?
56             Default is False
57         auto_adjust: bool
58             Adjust all OHLC automatically? Default is False
59         keepna: bool
60             Keep NaN rows returned by Yahoo?
61             Default is False
62         actions: bool
63             Download dividend + stock splits data. Default is False
64         threads: bool / int
65             How many threads to use for mass downloading. Default is True
66         proxy: str
67             Optional. Proxy server URL scheme. Default is None
68         rounding: bool
69             Optional. Round values to 2 decimal places?
70         show_errors: bool
71             Optional. Doesn't print errors if False
72         timeout: None or float
73             If not None stops waiting for a response after given number of
74             seconds. (Can also be a fraction of a second e.g. 0.01)
75     """
76 
77     # create ticker list
78     tickers = tickers if isinstance(
79         tickers, (list, set, tuple)) else tickers.replace(',', ' ').split()
80 
81     # accept isin as ticker
82     shared._ISINS = {}
83     _tickers_ = []
84     for ticker in tickers:
85         if utils.is_isin(ticker):
86             isin = ticker
87             ticker = utils.get_ticker_by_isin(ticker, proxy)
88             shared._ISINS[ticker] = isin
89         _tickers_.append(ticker)
90 
91     tickers = _tickers_
92 
93     tickers = list(set([ticker.upper() for ticker in tickers]))
94 
95     if progress:
96         shared._PROGRESS_BAR = utils.ProgressBar(len(tickers), 'completed')
97 
98     # reset shared._DFS
99     shared._DFS = {}
100     shared._ERRORS = {}
101 
102     # download using threads
103     if threads:
104         if threads is True:
105             threads = min([len(tickers), _multitasking.cpu_count() * 2])
106         _multitasking.set_max_threads(threads)
107         for i, ticker in enumerate(tickers):
108             _download_one_threaded(ticker, period=period, interval=interval,
109                                    start=start, end=end, prepost=prepost,
110                                    actions=actions, auto_adjust=auto_adjust,
111                                    back_adjust=back_adjust, keepna=keepna,
112                                    progress=(progress and i > 0), proxy=proxy,
113                                    rounding=rounding, timeout=timeout)
114         while len(shared._DFS) < len(tickers):
115             _time.sleep(0.01)
116 
117     # download synchronously
118     else:
119         for i, ticker in enumerate(tickers):
120             data = _download_one(ticker, period=period, interval=interval,
121                                  start=start, end=end, prepost=prepost,
122                                  actions=actions, auto_adjust=auto_adjust,
123                                  back_adjust=back_adjust, keepna=keepna, proxy=proxy,
124                                  rounding=rounding, timeout=timeout)
125             shared._DFS[ticker.upper()] = data
126             if progress:
127                 shared._PROGRESS_BAR.animate()
128 
129     if progress:
130         shared._PROGRESS_BAR.completed()
131 
132     if shared._ERRORS and show_errors:
133         print('\n%.f Failed download%s:' % (
134             len(shared._ERRORS), 's' if len(shared._ERRORS) > 1 else ''))
135         # print(shared._ERRORS)
136         print("\n".join(['- %s: %s' %
137                          v for v in list(shared._ERRORS.items())]))
138 
139     if len(tickers) == 1:
140         ticker = tickers[0]
141         return shared._DFS[shared._ISINS.get(ticker, ticker)]
142 
143     try:
144         data = _pd.concat(shared._DFS.values(), axis=1,
145                           keys=shared._DFS.keys())
146     except Exception:
147         _realign_dfs()
148         data = _pd.concat(shared._DFS.values(), axis=1,
149                           keys=shared._DFS.keys())
150 
151     # switch names back to isins if applicable
152     data.rename(columns=shared._ISINS, inplace=True)
153 
154     if group_by == 'column':
155         data.columns = data.columns.swaplevel(0, 1)
156         data.sort_index(level=0, axis=1, inplace=True)
157 
158     return data
159 
160 
161 def _realign_dfs():
162     idx_len = 0
163     idx = None
164 
165     for df in shared._DFS.values():
166         if len(df) > idx_len:
167             idx_len = len(df)
168             idx = df.index
169 
170     for key in shared._DFS.keys():
171         try:
172             shared._DFS[key] = _pd.DataFrame(
173                 index=idx, data=shared._DFS[key]).drop_duplicates()
174         except Exception:
175             shared._DFS[key] = _pd.concat([
176                 utils.empty_df(idx), shared._DFS[key].dropna()
177             ], axis=0, sort=True)
178 
179         # remove duplicate index
180         shared._DFS[key] = shared._DFS[key].loc[
181             ~shared._DFS[key].index.duplicated(keep='last')]
182 
183 
184 @_multitasking.task
185 def _download_one_threaded(ticker, start=None, end=None,
186                            auto_adjust=False, back_adjust=False,
187                            actions=False, progress=True, period="max",
188                            interval="1d", prepost=False, proxy=None,
189                            keepna=False, rounding=False, timeout=None):
190 
191     data = _download_one(ticker, start, end, auto_adjust, back_adjust,
192                          actions, period, interval, prepost, proxy, rounding,
193                          keepna, timeout)
194     shared._DFS[ticker.upper()] = data
195     if progress:
196         shared._PROGRESS_BAR.animate()
197 
198 
199 def _download_one(ticker, start=None, end=None,
200                   auto_adjust=False, back_adjust=False,
201                   actions=False, period="max", interval="1d",
202                   prepost=False, proxy=None, rounding=False,
203                   keepna=False, timeout=None):
204 
205     return Ticker(ticker).history(period=period, interval=interval,
206                                   start=start, end=end, prepost=prepost,
207                                   actions=actions, auto_adjust=auto_adjust,
208                                   back_adjust=back_adjust, proxy=proxy,
209                                   rounding=rounding, keepna=keepna, many=True,
210                                   timeout=timeout)
211
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/yfinance/multi.py b/yfinance/multi.py
--- a/yfinance/multi.py
+++ b/yfinance/multi.py
@@ -29,7 +29,7 @@
 from . import shared
 
 
-def download(tickers, start=None, end=None, actions=False, threads=True,
+def download(tickers, start=None, end=None, actions=False, threads=True, ignore_tz=True, 
              group_by='column', auto_adjust=False, back_adjust=False, keepna=False,
              progress=True, period="max", show_errors=True, interval="1d", prepost=False,
              proxy=None, rounding=False, timeout=None, **kwargs):
@@ -63,6 +63,9 @@
             Download dividend + stock splits data. Default is False
         threads: bool / int
             How many threads to use for mass downloading. Default is True
+        ignore_tz: bool
+            When combining from different timezones, ignore that part of datetime.
+            Default is True
         proxy: str
             Optional. Proxy server URL scheme. Default is None
         rounding: bool
@@ -140,12 +143,17 @@
         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)
+
     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

{"golden_diff": "diff --git a/yfinance/multi.py b/yfinance/multi.py\n--- a/yfinance/multi.py\n+++ b/yfinance/multi.py\n@@ -29,7 +29,7 @@\n from . import shared\n \n \n-def download(tickers, start=None, end=None, actions=False, threads=True,\n+def download(tickers, start=None, end=None, actions=False, threads=True, ignore_tz=True, \n              group_by='column', auto_adjust=False, back_adjust=False, keepna=False,\n              progress=True, period=\"max\", show_errors=True, interval=\"1d\", prepost=False,\n              proxy=None, rounding=False, timeout=None, **kwargs):\n@@ -63,6 +63,9 @@\n             Download dividend + stock splits data. Default is False\n         threads: bool / int\n             How many threads to use for mass downloading. Default is True\n+        ignore_tz: bool\n+            When combining from different timezones, ignore that part of datetime.\n+            Default is True\n         proxy: str\n             Optional. Proxy server URL scheme. Default is None\n         rounding: bool\n@@ -140,12 +143,17 @@\n         ticker = tickers[0]\n         return shared._DFS[shared._ISINS.get(ticker, ticker)]\n \n+    if ignore_tz:\n+        for tkr in shared._DFS.keys():\n+            if (shared._DFS[tkr] is not None) and (shared._DFS[tkr].shape[0]>0):\n+                shared._DFS[tkr].index = shared._DFS[tkr].index.tz_localize(None)\n+\n     try:\n-        data = _pd.concat(shared._DFS.values(), axis=1,\n+        data = _pd.concat(shared._DFS.values(), axis=1, sort=True,\n                           keys=shared._DFS.keys())\n     except Exception:\n         _realign_dfs()\n-        data = _pd.concat(shared._DFS.values(), axis=1,\n+        data = _pd.concat(shared._DFS.values(), axis=1, sort=True,\n                           keys=shared._DFS.keys())\n \n     # switch names back to isins if applicable\n", "issue": "Issues with Date field\nThis issue appeared in version 0.1.77. I did no other package or python version updates since then.\r\n\r\nFollowing script used to work on the date field:\r\n`df[df.Date > '2020-01-01']`\r\n\r\nBut I am now getting following error message: TypeError: '>' not supported between instances of 'Timestamp' and 'str'\r\n\r\nWhen I solve that issue by converting the string to a date (pd.to_datetime), I am getting other issues like: ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True\r\n\r\nSomewhat further in my script, there is a pd.merge function based on the Date field received from yfinance. It gives now following error: Cannot compare between dtype('<M8[ns]') and dtype('0')\r\n\r\nSo I guess something has changed with how the dates are passed through. If yes, do you know how I can strip the received date from all these tz related stuff and just use it as a datetime64? I tried things like .dt.normalize() or .dt.date, but it always seems to give errors. \n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# yfinance - market data downloader\n# https://github.com/ranaroussi/yfinance\n#\n# Copyright 2017-2019 Ran Aroussi\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nfrom __future__ import print_function\n\nimport time as _time\nimport multitasking as _multitasking\nimport pandas as _pd\n\nfrom . import Ticker, utils\nfrom . import shared\n\n\ndef download(tickers, start=None, end=None, actions=False, threads=True,\n             group_by='column', auto_adjust=False, back_adjust=False, keepna=False,\n             progress=True, period=\"max\", show_errors=True, interval=\"1d\", prepost=False,\n             proxy=None, rounding=False, timeout=None, **kwargs):\n    \"\"\"Download yahoo tickers\n    :Parameters:\n        tickers : str, list\n            List of tickers to download\n        period : str\n            Valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max\n            Either Use period parameter or use start and end\n        interval : str\n            Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo\n            Intraday data cannot extend last 60 days\n        start: str\n            Download start date string (YYYY-MM-DD) or _datetime.\n            Default is 1900-01-01\n        end: str\n            Download end date string (YYYY-MM-DD) or _datetime.\n            Default is now\n        group_by : str\n            Group by 'ticker' or 'column' (default)\n        prepost : bool\n            Include Pre and Post market data in results?\n            Default is False\n        auto_adjust: bool\n            Adjust all OHLC automatically? Default is False\n        keepna: bool\n            Keep NaN rows returned by Yahoo?\n            Default is False\n        actions: bool\n            Download dividend + stock splits data. Default is False\n        threads: bool / int\n            How many threads to use for mass downloading. Default is True\n        proxy: str\n            Optional. Proxy server URL scheme. Default is None\n        rounding: bool\n            Optional. Round values to 2 decimal places?\n        show_errors: bool\n            Optional. Doesn't print errors if False\n        timeout: None or float\n            If not None stops waiting for a response after given number of\n            seconds. (Can also be a fraction of a second e.g. 0.01)\n    \"\"\"\n\n    # create ticker list\n    tickers = tickers if isinstance(\n        tickers, (list, set, tuple)) else tickers.replace(',', ' ').split()\n\n    # accept isin as ticker\n    shared._ISINS = {}\n    _tickers_ = []\n    for ticker in tickers:\n        if utils.is_isin(ticker):\n            isin = ticker\n            ticker = utils.get_ticker_by_isin(ticker, proxy)\n            shared._ISINS[ticker] = isin\n        _tickers_.append(ticker)\n\n    tickers = _tickers_\n\n    tickers = list(set([ticker.upper() for ticker in tickers]))\n\n    if progress:\n        shared._PROGRESS_BAR = utils.ProgressBar(len(tickers), 'completed')\n\n    # reset shared._DFS\n    shared._DFS = {}\n    shared._ERRORS = {}\n\n    # download using threads\n    if threads:\n        if threads is True:\n            threads = min([len(tickers), _multitasking.cpu_count() * 2])\n        _multitasking.set_max_threads(threads)\n        for i, ticker in enumerate(tickers):\n            _download_one_threaded(ticker, period=period, interval=interval,\n                                   start=start, end=end, prepost=prepost,\n                                   actions=actions, auto_adjust=auto_adjust,\n                                   back_adjust=back_adjust, keepna=keepna,\n                                   progress=(progress and i > 0), proxy=proxy,\n                                   rounding=rounding, timeout=timeout)\n        while len(shared._DFS) < len(tickers):\n            _time.sleep(0.01)\n\n    # download synchronously\n    else:\n        for i, ticker in enumerate(tickers):\n            data = _download_one(ticker, period=period, interval=interval,\n                                 start=start, end=end, prepost=prepost,\n                                 actions=actions, auto_adjust=auto_adjust,\n                                 back_adjust=back_adjust, keepna=keepna, proxy=proxy,\n                                 rounding=rounding, timeout=timeout)\n            shared._DFS[ticker.upper()] = data\n            if progress:\n                shared._PROGRESS_BAR.animate()\n\n    if progress:\n        shared._PROGRESS_BAR.completed()\n\n    if shared._ERRORS and show_errors:\n        print('\\n%.f Failed download%s:' % (\n            len(shared._ERRORS), 's' if len(shared._ERRORS) > 1 else ''))\n        # print(shared._ERRORS)\n        print(\"\\n\".join(['- %s: %s' %\n                         v for v in list(shared._ERRORS.items())]))\n\n    if len(tickers) == 1:\n        ticker = tickers[0]\n        return shared._DFS[shared._ISINS.get(ticker, ticker)]\n\n    try:\n        data = _pd.concat(shared._DFS.values(), axis=1,\n                          keys=shared._DFS.keys())\n    except Exception:\n        _realign_dfs()\n        data = _pd.concat(shared._DFS.values(), axis=1,\n                          keys=shared._DFS.keys())\n\n    # switch names back to isins if applicable\n    data.rename(columns=shared._ISINS, inplace=True)\n\n    if group_by == 'column':\n        data.columns = data.columns.swaplevel(0, 1)\n        data.sort_index(level=0, axis=1, inplace=True)\n\n    return data\n\n\ndef _realign_dfs():\n    idx_len = 0\n    idx = None\n\n    for df in shared._DFS.values():\n        if len(df) > idx_len:\n            idx_len = len(df)\n            idx = df.index\n\n    for key in shared._DFS.keys():\n        try:\n            shared._DFS[key] = _pd.DataFrame(\n                index=idx, data=shared._DFS[key]).drop_duplicates()\n        except Exception:\n            shared._DFS[key] = _pd.concat([\n                utils.empty_df(idx), shared._DFS[key].dropna()\n            ], axis=0, sort=True)\n\n        # remove duplicate index\n        shared._DFS[key] = shared._DFS[key].loc[\n            ~shared._DFS[key].index.duplicated(keep='last')]\n\n\n@_multitasking.task\ndef _download_one_threaded(ticker, start=None, end=None,\n                           auto_adjust=False, back_adjust=False,\n                           actions=False, progress=True, period=\"max\",\n                           interval=\"1d\", prepost=False, proxy=None,\n                           keepna=False, rounding=False, timeout=None):\n\n    data = _download_one(ticker, start, end, auto_adjust, back_adjust,\n                         actions, period, interval, prepost, proxy, rounding,\n                         keepna, timeout)\n    shared._DFS[ticker.upper()] = data\n    if progress:\n        shared._PROGRESS_BAR.animate()\n\n\ndef _download_one(ticker, start=None, end=None,\n                  auto_adjust=False, back_adjust=False,\n                  actions=False, period=\"max\", interval=\"1d\",\n                  prepost=False, proxy=None, rounding=False,\n                  keepna=False, timeout=None):\n\n    return Ticker(ticker).history(period=period, interval=interval,\n                                  start=start, end=end, prepost=prepost,\n                                  actions=actions, auto_adjust=auto_adjust,\n                                  back_adjust=back_adjust, proxy=proxy,\n                                  rounding=rounding, keepna=keepna, many=True,\n                                  timeout=timeout)\n", "path": "yfinance/multi.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# yfinance - market data downloader\n# https://github.com/ranaroussi/yfinance\n#\n# Copyright 2017-2019 Ran Aroussi\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nfrom __future__ import print_function\n\nimport time as _time\nimport multitasking as _multitasking\nimport pandas as _pd\n\nfrom . import Ticker, utils\nfrom . import shared\n\n\ndef download(tickers, start=None, end=None, actions=False, threads=True, ignore_tz=True, \n             group_by='column', auto_adjust=False, back_adjust=False, keepna=False,\n             progress=True, period=\"max\", show_errors=True, interval=\"1d\", prepost=False,\n             proxy=None, rounding=False, timeout=None, **kwargs):\n    \"\"\"Download yahoo tickers\n    :Parameters:\n        tickers : str, list\n            List of tickers to download\n        period : str\n            Valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max\n            Either Use period parameter or use start and end\n        interval : str\n            Valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo\n            Intraday data cannot extend last 60 days\n        start: str\n            Download start date string (YYYY-MM-DD) or _datetime.\n            Default is 1900-01-01\n        end: str\n            Download end date string (YYYY-MM-DD) or _datetime.\n            Default is now\n        group_by : str\n            Group by 'ticker' or 'column' (default)\n        prepost : bool\n            Include Pre and Post market data in results?\n            Default is False\n        auto_adjust: bool\n            Adjust all OHLC automatically? Default is False\n        keepna: bool\n            Keep NaN rows returned by Yahoo?\n            Default is False\n        actions: bool\n            Download dividend + stock splits data. Default is False\n        threads: bool / int\n            How many threads to use for mass downloading. Default is True\n        ignore_tz: bool\n            When combining from different timezones, ignore that part of datetime.\n            Default is True\n        proxy: str\n            Optional. Proxy server URL scheme. Default is None\n        rounding: bool\n            Optional. Round values to 2 decimal places?\n        show_errors: bool\n            Optional. Doesn't print errors if False\n        timeout: None or float\n            If not None stops waiting for a response after given number of\n            seconds. (Can also be a fraction of a second e.g. 0.01)\n    \"\"\"\n\n    # create ticker list\n    tickers = tickers if isinstance(\n        tickers, (list, set, tuple)) else tickers.replace(',', ' ').split()\n\n    # accept isin as ticker\n    shared._ISINS = {}\n    _tickers_ = []\n    for ticker in tickers:\n        if utils.is_isin(ticker):\n            isin = ticker\n            ticker = utils.get_ticker_by_isin(ticker, proxy)\n            shared._ISINS[ticker] = isin\n        _tickers_.append(ticker)\n\n    tickers = _tickers_\n\n    tickers = list(set([ticker.upper() for ticker in tickers]))\n\n    if progress:\n        shared._PROGRESS_BAR = utils.ProgressBar(len(tickers), 'completed')\n\n    # reset shared._DFS\n    shared._DFS = {}\n    shared._ERRORS = {}\n\n    # download using threads\n    if threads:\n        if threads is True:\n            threads = min([len(tickers), _multitasking.cpu_count() * 2])\n        _multitasking.set_max_threads(threads)\n        for i, ticker in enumerate(tickers):\n            _download_one_threaded(ticker, period=period, interval=interval,\n                                   start=start, end=end, prepost=prepost,\n                                   actions=actions, auto_adjust=auto_adjust,\n                                   back_adjust=back_adjust, keepna=keepna,\n                                   progress=(progress and i > 0), proxy=proxy,\n                                   rounding=rounding, timeout=timeout)\n        while len(shared._DFS) < len(tickers):\n            _time.sleep(0.01)\n\n    # download synchronously\n    else:\n        for i, ticker in enumerate(tickers):\n            data = _download_one(ticker, period=period, interval=interval,\n                                 start=start, end=end, prepost=prepost,\n                                 actions=actions, auto_adjust=auto_adjust,\n                                 back_adjust=back_adjust, keepna=keepna, proxy=proxy,\n                                 rounding=rounding, timeout=timeout)\n            shared._DFS[ticker.upper()] = data\n            if progress:\n                shared._PROGRESS_BAR.animate()\n\n    if progress:\n        shared._PROGRESS_BAR.completed()\n\n    if shared._ERRORS and show_errors:\n        print('\\n%.f Failed download%s:' % (\n            len(shared._ERRORS), 's' if len(shared._ERRORS) > 1 else ''))\n        # print(shared._ERRORS)\n        print(\"\\n\".join(['- %s: %s' %\n                         v for v in list(shared._ERRORS.items())]))\n\n    if len(tickers) == 1:\n        ticker = tickers[0]\n        return shared._DFS[shared._ISINS.get(ticker, ticker)]\n\n    if ignore_tz:\n        for tkr in shared._DFS.keys():\n            if (shared._DFS[tkr] is not None) and (shared._DFS[tkr].shape[0]>0):\n                shared._DFS[tkr].index = shared._DFS[tkr].index.tz_localize(None)\n\n    try:\n        data = _pd.concat(shared._DFS.values(), axis=1, sort=True,\n                          keys=shared._DFS.keys())\n    except Exception:\n        _realign_dfs()\n        data = _pd.concat(shared._DFS.values(), axis=1, sort=True,\n                          keys=shared._DFS.keys())\n\n    # switch names back to isins if applicable\n    data.rename(columns=shared._ISINS, inplace=True)\n\n    if group_by == 'column':\n        data.columns = data.columns.swaplevel(0, 1)\n        data.sort_index(level=0, axis=1, inplace=True)\n\n    return data\n\n\ndef _realign_dfs():\n    idx_len = 0\n    idx = None\n\n    for df in shared._DFS.values():\n        if len(df) > idx_len:\n            idx_len = len(df)\n            idx = df.index\n\n    for key in shared._DFS.keys():\n        try:\n            shared._DFS[key] = _pd.DataFrame(\n                index=idx, data=shared._DFS[key]).drop_duplicates()\n        except Exception:\n            shared._DFS[key] = _pd.concat([\n                utils.empty_df(idx), shared._DFS[key].dropna()\n            ], axis=0, sort=True)\n\n        # remove duplicate index\n        shared._DFS[key] = shared._DFS[key].loc[\n            ~shared._DFS[key].index.duplicated(keep='last')]\n\n\n@_multitasking.task\ndef _download_one_threaded(ticker, start=None, end=None,\n                           auto_adjust=False, back_adjust=False,\n                           actions=False, progress=True, period=\"max\",\n                           interval=\"1d\", prepost=False, proxy=None,\n                           keepna=False, rounding=False, timeout=None):\n\n    data = _download_one(ticker, start, end, auto_adjust, back_adjust,\n                         actions, period, interval, prepost, proxy, rounding,\n                         keepna, timeout)\n    shared._DFS[ticker.upper()] = data\n    if progress:\n        shared._PROGRESS_BAR.animate()\n\n\ndef _download_one(ticker, start=None, end=None,\n                  auto_adjust=False, back_adjust=False,\n                  actions=False, period=\"max\", interval=\"1d\",\n                  prepost=False, proxy=None, rounding=False,\n                  keepna=False, timeout=None):\n\n    return Ticker(ticker).history(period=period, interval=interval,\n                                  start=start, end=end, prepost=prepost,\n                                  actions=actions, auto_adjust=auto_adjust,\n                                  back_adjust=back_adjust, proxy=proxy,\n                                  rounding=rounding, keepna=keepna, many=True,\n                                  timeout=timeout)\n", "path": "yfinance/multi.py"}]}