Python pandas, adding in my time series column as a data frame -


i doing rest api call building automation system gather data , calculation in pandas series. scrip below output shell snip further down. would know how account "time" in hours? how need divide btu_hr elapsed time in hours reveal units of energy in btu. if can know elapsed time in seconds or minutes can convert hours...

#get data hot water system supply temp & convert pandas series: hws = session.find_entity(filter_expr='primaryhws').result hws_df = session.his_read_frame(hws, rng= '2017-05-01,2017-07-25').result hws_df = pd.series(hws_df[hws_df.columns[0]])  #get data hot water return temp & convert pandas series: hwr = session.find_entity(filter_expr='secondaryhwr').result hwr_df = session.his_read_frame(hwr, rng= '2017-05-01,2017-07-25').result hwr_df = pd.series(hwr_df[hwr_df.columns[0]])   #create dataframe supply & return temp. use ffill merge missing data math boilertemps = pd.dataframe({'hws' : hws_df, 'hwr' : hwr_df}) boilertemps = boilertemps.fillna(method = 'ffill').fillna(method = 'bfill')  #show statistics print(boilertemps.describe())   #create dataframe btu/hr calculations btu_hr = boilertemps  #energy calculation, gpm * delta t (replace negative values zero) * 500 * efficiency btu_hr['btu_hr'] = 400 * ((btu_hr['hws'] - btu_hr['hwr']).clip_lower(0)) * 500 * 1.1  #show statistics print(btu_hr.describe()) print(btu_hr) 

shell output snip


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -