diff --git a/main.py b/main.py index 9de3f6e..abaf224 100644 --- a/main.py +++ b/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()