Skip to content

Instantly share code, notes, and snippets.

@alphazwest
Created November 29, 2021 23:17
Show Gist options
  • Save alphazwest/3eff6ae731311bf4ce22afa83ed09037 to your computer and use it in GitHub Desktop.
Save alphazwest/3eff6ae731311bf4ce22afa83ed09037 to your computer and use it in GitHub Desktop.
# Get pricing data
import yfinance as yf
# Get the previous 6 months pricing data for ETH and limit to High, Low
ETH = yf.Ticker('ETH-USD').history(period='6mo', interval="1d")[["High", "Low"]]
# View resulting dataframe
print(ETH)
High Low
Date
2021-05-18 3562.465088 3246.404053
2021-05-19 3437.935791 1952.460205
2021-05-20 2993.145264 2170.229004
2021-05-21 2938.205078 2113.347168
2021-05-22 2483.983154 2168.124268
... ... ...
2021-11-14 4689.842773 4516.935547
2021-11-15 4764.636230 4546.599121
2021-11-16 4891.704590 4144.334961
2021-11-17 4300.306641 4107.125977
2021-11-18 4343.557129 4138.691406
[185 rows x 2 columns]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment