0
votes

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.

This is the output I am getting, I want to take all the values that say Failed Download and remove their ticker symbols from the list

Welcome to SO. What errors are you getting? What happens when you run the code?ewong
Neither NTT nor EON are not present in Yahoo finance. Where did you get your ticker list from?Yuri Ginsburg