error getting SP_500 data

As the tutorial says,I use SP_500_list = list(alphien.data.getTickersSP500().ticker) to get ticker and use alphien.data.getHistoryData(SP_500_list field = ‘bb_live’, zoom=‘2006::2017’) to get data.But an error returned,it seemed that it could not get data of some tickers.

when I choose a subset to collect data,it worked well.

Hello,

can you restart your kernel and try the code below?

Hi, I’m having the same kind of issue in R. Using Unique does not seem to work on the tickers data which I need to get the constituentStart and constituentEnd data.

Do you know any way to do this?

Hello - which ticker are you try to get ? The code in R that gets you all the tickers that you need is :


tickers = getTickersSP500()$ticker

x = getHistoryData(tickers, zoom=“2007::2016”, asXts=TRUE)

dim(x)


very easy !


in Python :


tkr = alphien.data.getTickersSP500()[‘ticker’]

dta = alphien.data.getHistoryData(tkr, field = ‘bb_live’,zoom=‘2007::2016’)

dta.shape


It can last up to 60 seconds to get all the data !


If you can’t get the above to work contact the live support as the error must be due to your own set-up.


Happy coding ! Lionel.

I did manage all the tickers but I want to filter out the duplicate ones, there seem to be 11 of those and the classic duplicate filter functions do not seem to work on this dataset.


Hello,


Have you tried using unique on the ticker column?


Yes, but now you lost all the other columns, which still have more rows according to my code…

How can I filter out these rows that are gone in the entire tickers dataframe?


The tickers are duplicated because they have exited and entered the S&P within the time period. For example,

tickers[tickers$ticker %in% ‘CB.US Equity’,]

If you really want a table with no duplicated tickers, you can do the below but you will lose some data

Okay, this works, thank you!!