I am trying to build my own portfolio report that tracks the different stocks that I have been bought at different dates in the past - below is the code, but I get the following error: ValueError: time data 'AMZN_start' does not match format '%Y-%m-%d'
import pandas as pd
import yfinance as yf
import datetime as dt
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import style
TempDF = pd.DataFrame() # 2020-11-09
# getting stock ticker
tickers = ['AMZN','NVDA']
starts = ['2016-08-26','2020-03-24'] # update 2020-11-9
end = dt.datetime.today()
# Ticker to download update:2020-11-9
for ticker,start in zip(tickers, starts):
data = yf.download(ticker, start, end, interval="1d")
TempDF = TempDF.append(data) # update 2020-11-09
# Creating DF and adding metrics
#TempDF = pd.DataFrame(data)
TempDF.drop(TempDF.columns[[0,1,2,3,5]], axis=1, inplace=True)
TempDF['DailyReturn'] = TempDF['Adj Close'].pct_change()
TempDF.fillna(method='bfill', inplace=True)