I'm using SHARADAR/DAILY data . the dataset/ data frame looks like this.
i need to write a piece of code that returns the latest marketcap value.
when i write the following code...
trade_date = "2021-05-16"
df2 = quandl.get_table('SHARADAR/DAILY', ticker='AAPL', date=trade_date)
print(df2)
the result is empty an dataframe
Series([], Name: marketcap, dtype: object)
i need to do two things...
i need it to return a single value , not a dataframe, so that i can do arithmetic calculations with it.
I need to create a loop that checks.. if value is empty, try to get marketcap for "trade_date" minus one day which is "2021-05-15", else return marketcap. keep minus-ing one day until we get a non-blank/ non-zero market cap
Empty DataFrame Columns: [ticker, date, lastupdated, ev, evebit, evebitda, marketcap, pb, pe, ps] Index: []