Created
August 6, 2021 02:18
-
-
Save SathishN/68287997d35fd813ad2e54f7f5dcd562 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resample(df, interval='5min'): | |
df_s = df.copy() | |
df_r = df_s.resample(interval, label='right', closed='right') \ | |
.agg({'Open': 'first', | |
'High': 'max', | |
'Low': 'min', | |
'Close': 'last', | |
'Volume': 'sum', | |
'OI': 'last'}).dropna() | |
# print(df_r.to_string()) | |
return df_r.copy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment