fix code
This commit is contained in:
parent
c28f6de648
commit
7344c2dd3e
5
main.py
5
main.py
@ -101,10 +101,7 @@ url = "http://time-series.athene.tech/api/1.0/getForecast"
|
||||
headers = {'Content-type': 'application/json'}
|
||||
r = requests.post(url, data=json.dumps(time_series), headers=headers)
|
||||
|
||||
forecast = []
|
||||
for v in r.json()['timeSeries']['values']:
|
||||
forecast.append(v['value'])
|
||||
forecast = list(filter(lambda a: a !=0, forecast))
|
||||
forecast = [item['value'] for item in r.json()['timeSeries']['values']]
|
||||
plt.plot(range(1, 1+len(source)), source)
|
||||
plt.plot(range(len(source), len(source)+len(forecast)), forecast)
|
||||
plt.grid()
|
||||
|
Loading…
Reference in New Issue
Block a user