analysis_timeseries.py , the code that generate the final outcome