Skip to content

Instantly share code, notes, and snippets.

@amitrani6
Created January 10, 2020 03:49
Show Gist options
  • Save amitrani6/898e2f205962fa431820c4af32a39c45 to your computer and use it in GitHub Desktop.
Save amitrani6/898e2f205962fa431820c4af32a39c45 to your computer and use it in GitHub Desktop.
Transformations of time series data
# Create transformation columns of the adjusted close price
# Calculate the log of the adjusted close prices
inx_df['adj_close_log'] = np.log(inx_df['adj_close'])
# Calculate the square root of the adjusted close prices
inx_df['adj_close_sqrt'] = np.sqrt(inx_df['adj_close'])
# Calculate the cubed root of the adjusted close prices
inx_df['adj_close_cbrt'] = np.cbrt(inx_df['adj_close'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment