-
-
Save amankharwal/5e55d004baaa9436f7701873a5083e42 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
# Time Series | |
import pandas as pd | |
import pandas_datareader.data as web | |
import matplotlib.pyplot as plt | |
import datetime | |
from datetime import date, timedelta | |
today = date.today() | |
d1 = today.strftime("%Y/%m/%d") | |
end_date = d1 | |
d2 = date.today() - timedelta(days=360) | |
start_date = d2.strftime("%Y/%m/%d") | |
data = web.DataReader(name="TSLA", data_source='yahoo', start=start_date, end=end_date) | |
figure = data["Close"].plot(figsize=(12, 8), title="Tesla Stock Prices", fontsize=20, label="Close Price") | |
plt.legend() | |
plt.grid() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment