Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvote
Accepted
22 5 3 7

Get an clean data from Api in python

Hi, I'm introducing the following code to get the data via api. There are many row that are empty. There will be some code that I can put so that the empty data is put by N.A and separated by ","

ek.get_timeseries(['AGR.BA','ALU.BA','APBR.BA','AUS.BA','HI.BA','MA.BA','BPAT.BA','BYMA.BA', 'CAMb.BA','CAO.BA','CARC.BA','CAU.BA','CEC.BA','CEL.BA','CEPU.BA','CLA.BA', 'COL.BA','COM.BA','CON.BA','CPS.BA','CRE.BA','CVH.BA','DOM.BA','DYC.BA', 'ECO.BA','EDLH.BA','EDN.BA','EDSH.BA','EMD.BA','ESM.BA','FER.BA','FIP.BA', 'FRA.BA','GAR.BA','GBA.BA','GFG.BA','GRM.BA','HARG.BA','HAVH.BA','INA.BA', 'INR.BA','INU.BA','INVJ.BA','IRCP.BA','IRS.BA','LED.BA','LOMA.BA','LON.BA', 'MERA.BA','MET.BA','MIR.BA','MOL.BA','MOLA.BA','MOR.BA','OEST.BA','PAM.BA', 'PAT.BA','PETR.BA','PGR.BA','POL.BA','PSU.BA','QUI.BA','REP.BA','RICH.BA', 'RIG.BA','RIO.BA','ROS.BA','SEI.BA','SMI.BA','STD.BA','SUPV.BA','TEC2.BA', 'TEF.BA','TENA.BA','TGLT.BA','TGNC.BA','TGS2.BA','TRA.BA','TXAR.BA','VAL.BA', 'YPFD.BA','YPFD.BA'], start_date='2000-01-01' , end_date='2018-01-01')

df.to_csv('galicia_2016_20128.csv')

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiapidata
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@pablo
Thank you for your participation in the forum. Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply that best answers your question. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.
Thanks,
-AHS

Hello @pablo

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
17.4k 82 39 63

Hi @pablo,

If I understand you correctly, you would like to replace the empty data that appears in you file with some value like "NA"? If so, try this:

df = df.fillna('NA')
df.to_csv('galicia_2016_20128.csv')
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.