From 8eace5600b6077216a044556d468222e71ffc5f0 Mon Sep 17 00:00:00 2001 From: Nico Kuhn Date: Mon, 15 Apr 2019 20:49:18 +0200 Subject: [PATCH] Fixed Bug: KeyError: for batch querry For passing tickers as list for e.g. ['AAPL, 'GOOGL'], the concat operation results in KeyError: 'AAPL', because the df does not contain this index --- tiingo/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiingo/api.py b/tiingo/api.py index f2ec61bb..4739b4c6 100644 --- a/tiingo/api.py +++ b/tiingo/api.py @@ -263,7 +263,7 @@ def get_dataframe(self, tickers, df = pd.DataFrame(response.json()) df.index = df['date'] df.rename(index=str, columns={metric_name: stock}, inplace=True) - prices = pd.concat([prices, df[stock]], axis=1) + prices = pd.concat([prices, df], axis=1) prices.index = pd.to_datetime(prices.index) return prices else: