Why does Eikon.get_data() return a tuple

Hi,

when I run this code line it returns a tuple (of tuples?) where I would have expected a data frame.

Is this to be expected?

const_data=ek.get_data(members,['TR.MarketCapLocalCurn','TR.GicsSector'])

Best Answer

  • chavalit-jintamalit
    Answer ✓

    Hi @mbp
    "

    Either single or multiple item, the return type is tuple.

    image

    If you want dataframe, you can follow the code nick suggested.

    image

Answers

  • Hi @mbp,

    The get_data() returns a tuple to capture the data and a list of error details, if any:

    image

    If you are strictly interest in the data, you simply need to construct your return value as:

    image

    thanks.

  • Hi again.

    When there is one item in members it returns a dataframe, but when there are more than one it returns a tuple.

    I don't think you've answered the question.

    rgds

  • Or just add [0] in the end

    image