📜  带有实时 ercot 实时价格的 python api - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:24.746000             🧑  作者: Mango

代码示例2
#Conver the dataframe to a numpy array
master_array=np.array(master_df[['Electricity_Price_Transformed_Differenced', 
                                     'Nat_Gas_Price_MCF_Transformed_Differenced']].dropna())
    
#Generate a training and test set for building the model: 95/5 split
training_set = master_array[:int(0.95*(len(master_array)))]
test_set = master_array[int(0.95*(len(master_array))):]
    
#Fit to a VAR model
model = VAR(endog=training_set)
model_fit = model.fit()
#Print a summary of the model results
model_fit.summary()