Skip to content

Instantly share code, notes, and snippets.

@SajidLhessani
Created September 6, 2021 00:50
Show Gist options
  • Save SajidLhessani/99487233c13f4ad15acb01ffbd1bdf17 to your computer and use it in GitHub Desktop.
Save SajidLhessani/99487233c13f4ad15acb01ffbd1bdf17 to your computer and use it in GitHub Desktop.
# Create columns 'OO' with the difference between the current minute's open and last minute's open
df['OO'] = df['Open']-df['Open'].shift(1)
# Create columns 'OC' with the difference between the current minute's open and last minute's close
df['OC'] = df['Open']-df['Prev_Close']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment