I made a function that takes in a ticker symbol and loads a data frame with the corresponding chart values for that company, I want to read the output that it gives and remove those tickers from the list that I have no data for. How should I do this?
Python Code:
#Get data Command
def get_data(tick,per,inter):
data = yf.download(tickers=tick, period=per, interval=inter)
#Loading Ticker Symbols
df_tick = pd.read_excel(r'C:\Users\paliw\2000_tick.xlsx')
print (df_tick)
#Creating a list of Ticks
ticklist = []
for i in df_tick[['Symbol']]:
ticklist = df_tick[i]
for i in ticklist:
get_data(i,'1y','1d')
When I run my command then sometimes I get a failed download, I want to remove these ticker value from the list.
NTT
norEON
are not present in Yahoo finance. Where did you get your ticker list from? – Yuri Ginsburg