Python: setting parameters to 'None' produces errors.

Hello,

I would like to know how to set some parameters to "None" without it producing errors in the data request.

e.g.

df = ek.get_data(identifiers, ['TR.CapitalExpenditures','TR.CashFromOperatingAct'], {'SDate':'0CY','Period':'FY0','Scale':6, 'Curn':'USD'})[0]

If I wanted to do 'Curn': None, I get errors. Is there a way to omit certain parameters like this?

Thanks in advance!

Best Answer

  • Just omit the parameter from the request. In your example use

    ek.get_data(identifiers, ['TR.CapitalExpenditures','TR.CashFromOperatingAct'], {'SDate':'0CY','Period':'FY0','Scale':6})
    'Curn' parameter is useful when you want to convert income statement or balance sheet items to the currency other than the currency of the company report. E.g. when you look at companies from different countries you may want to view their fundamentals in the same currency for easy comparison. If you'd like to retrieve company fundamentals in the currency in which the company reported them, just don't put the 'Curn' parameter in the request.