While executing the below code, copied from a sample notebook,
tkr = getTickersSP500().ticker.unique().tolist()
df = DataFeatures(tickers=tkr)
inclusionMatrix = getTickersSP500(ticker=df.tickers, startDate=df.startDate, endDate=df.endDate, asMatrix=True)
an error arises,
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
<ipython-input-4-e1002228393d> in <module>
----> 1 inclusionMatrix = getTickersSP500(ticker=df.tickers, startDate=df.startDate, endDate=df.endDate, asMatrix=True)/mnt/public/IT/Libs/Python/alphien/data/getTickersSP500.py in getTickersSP500(ticker, industryCode, industry, zoom, asMatrix, macroData, asPrice, startDate, endDate)
140
141 if asMatrix:
–> 142 df1 = getStaticAPI(‘gettickerssp500’, themeTag=‘equity’)
143 df1.constituentEnd = np.where(df1.constituentEnd == ‘null’, np.NaN, df1.constituentEnd)
144 df1.constituentEnd = pd.to_datetime(df1.constituentEnd)/mnt/public/IT/Libs/Python/alphien/database/getStaticAPI.py in getStaticAPI(tableName, themeTag)
47 # If ther is no error, parse the JSON to a pandas DataFrame and
48 # set the index to the value of column ‘tablerownames’
—> 49 if response.json()[“success”] is False:
50 # Error returned on API level
51 errorMessage = response.json()[“message”]/opt/conda/lib/python3.6/site-packages/requests/models.py in json(self, **kwargs)
896 # used.
897 pass
–> 898 return complexjson.loads(self.text, **kwargs)
899
900 @property/opt/conda/lib/python3.6/json/init.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
352 parse_int is None and parse_float is None and
353 parse_constant is None and object_pairs_hook is None and not kw):
–> 354 return _default_decoder.decode(s)
355 if cls is None:
356 cls = JSONDecoder/opt/conda/lib/python3.6/json/decoder.py in decode(self, s, _w)
337
338 “”"
–> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
340 end = _w(s, end).end()
341 if end != len(s):/opt/conda/lib/python3.6/json/decoder.py in raw_decode(self, s, idx)
355 obj, end = self.scan_once(s, idx)
356 except StopIteration as err:
–> 357 raise JSONDecodeError(“Expecting value”, s, err.value) from None
358 return obj, endJSONDecodeError: Expecting value: line 1 column 1 (char 0)
Is there a fix for this?