updated python script for timeseries data