def plot_ajuste_prod_dem(self, prodtot=None, exceso=None): # Plot Ajuste entre Producción total y Demanda datos_plot = data if data is not None else self.data # TODO Arreglar plot prod vs dem rdp.plot_ajuste_prod_dem(prodtot, exceso)
# print pd.Timestamp('2007-10-30').weekday() str_dia = '2007-10-26' print df0.columns print df0.ix[0] prod = df0[COLS_PROD] prodtot = prod.sum(axis=1) exceso = prod.sum(axis=1) - df0.dem # print prodtot.head(), prodtot.tail() #print df0.dem.head(), df0.dem.tail() print exceso.head(), exceso.tail() # Plot Producción total vs Demanda rdp.plot_prod_vs_dem(prodtot, df0.dem) # Plot Ajuste entre Producción total y Demanda rdp.plot_ajuste_prod_dem(prodtot, exceso) # Plot Producción por tipos rdp.plot_tipos_prod(df0, cols_prod=COLS_PROD) # Plot Stack Producción por tipos rdp.plotarea_stack_tipos_prod(df0, cols_prod=COLS_PROD) idx_utc = data.index.tz_convert('UTC') tt = idx_utc.values delta = tt[1:] - tt[:-1] delta.dtype = np.int64 delta /= 1e9 * TS_DATA data['delta_T'] = pd.Series(data=delta, index=data.index[1:]) data.delta_T.fillna(1, inplace=True)
str_dia = '2007-10-26' print df0.columns print df0.ix[0] prod = df0[COLS_PROD] prodtot = prod.sum(axis=1) exceso = prod.sum(axis=1) - df0.dem # print prodtot.head(), prodtot.tail() #print df0.dem.head(), df0.dem.tail() print exceso.head(), exceso.tail() # Plot Producción total vs Demanda rdp.plot_prod_vs_dem(prodtot, df0.dem) # Plot Ajuste entre Producción total y Demanda rdp.plot_ajuste_prod_dem(prodtot, exceso) # Plot Producción por tipos rdp.plot_tipos_prod(df0, cols_prod=COLS_PROD) # Plot Stack Producción por tipos rdp.plotarea_stack_tipos_prod(df0, cols_prod=COLS_PROD) idx_utc = data.index.tz_convert('UTC') tt = idx_utc.values delta = tt[1:] - tt[:-1] delta.dtype = np.int64 delta /= 1e9 * TS_DATA data['delta_T'] = pd.Series(data=delta, index=data.index[1:]) data.delta_T.fillna(1, inplace=True)