Skip to content

Instantly share code, notes, and snippets.

@kperry2215
Created July 20, 2019 02:47
Show Gist options
  • Save kperry2215/9a08723c674cd8f83880884a566f0929 to your computer and use it in GitHub Desktop.
Save kperry2215/9a08723c674cd8f83880884a566f0929 to your computer and use it in GitHub Desktop.
#Transform the columns using natural log
master_df['Electricity_Price_Transformed']=np.log(master_df['Electricity_Price'])
master_df['Nat_Gas_Price_MCF_Transformed']=np.log(master_df['Nat_Gas_Price_MCF'])
#Difference the data by 1 month
n=1
master_df['Electricity_Price_Transformed_Differenced'] = master_df['Electricity_Price_Transformed'] - master_df['Electricity_Price_Transformed'].shift(n)
master_df['Nat_Gas_Price_MCF_Transformed_Differenced'] = master_df['Nat_Gas_Price_MCF_Transformed'] - master_df['Nat_Gas_Price_MCF_Transformed'].shift(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment