Created
July 12, 2021 12:18
-
-
Save quantra-go-algo/c8786ae3955235e421f96e56ef48ed76 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
# Import package & get the data | |
import yfinance as yf | |
intraday_data = yf.download(tickers="MSFT", | |
period="5d", | |
interval="1m", | |
auto_adjust=True) | |
# Define the resampling logic | |
ohlcv_dict = { | |
'Open': 'first', | |
'High': 'max', | |
'Low': 'min', | |
'Close': 'last', | |
'Volume': 'sum' | |
} | |
# Resample the data | |
intraday_data_10 = intraday_data.resample('10T').agg(ohlcv_dict) | |
intraday_data_10.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment