Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONDecodeError: Expecting value: line 1 column 1 (char 0) #33

Open
chexki opened this issue Jul 12, 2022 · 0 comments
Open

JSONDecodeError: Expecting value: line 1 column 1 (char 0) #33

chexki opened this issue Jul 12, 2022 · 0 comments

Comments

@chexki
Copy link

chexki commented Jul 12, 2022

I'm using tommorow API for getting the predictions.

import stocker
stocker.predict.tomorrow('AAPL')

JSONDecodeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_21972/3407483949.py in
1 import stocker
----> 2 stocker.predict.tomorrow('AAPL')

~\anaconda3\envs\Animal_Movement_Tracker\lib\site-packages\stocker\predict.py in tomorrow(stock, features, steps, training, interest, wiki_views, indicators, period, years, error_method)
6 def tomorrow(stock, features=[], steps=1, training=0.9, interest=False, wiki_views=False, indicators=False, period=14,
7 years=1, error_method='mape'):
----> 8 stock_data = total(stock, years, interest, wiki_views, indicators, period)
9 result = run(stock_data, features, steps, training, error_method)
10 date = (dt.datetime.today() + dt.timedelta(days=1)).strftime('%Y-%m-%d')

~\anaconda3\envs\Animal_Movement_Tracker\lib\site-packages\stocker\get_data.py in total(stock, years, interest, wiki_views, indicators, period)
109 def total(stock, years=1, interest=False, wiki_views=False, indicators=False, period=14):
110 df, start, end = main(stock, years)
--> 111 company = company_name(stock)
112
113 if interest:

~\anaconda3\envs\Animal_Movement_Tracker\lib\site-packages\stocker\get_data.py in company_name(stock)
16 def company_name(stock):
17 url = "http://d.yimg.com/autoc.finance.yahoo.com/autoc?query={}&region=1&lang=en".format(stock)
---> 18 company = requests.get(url).json()['ResultSet']['Result'][0]['name']
19
20 return company

~\anaconda3\envs\Animal_Movement_Tracker\lib\site-packages\requests\models.py in json(self, **kwargs)
908 # used.
909 pass
--> 910 return complexjson.loads(self.text, **kwargs)
911
912 @Property

~\anaconda3\envs\Animal_Movement_Tracker\lib\json_init_.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
346 parse_int is None and parse_float is None and
347 parse_constant is None and object_pairs_hook is None and not kw):
--> 348 return _default_decoder.decode(s)
349 if cls is None:
350 cls = JSONDecoder

~\anaconda3\envs\Animal_Movement_Tracker\lib\json\decoder.py in decode(self, s, _w)
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):

~\anaconda3\envs\Animal_Movement_Tracker\lib\json\decoder.py in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant