Python access to eviews databases

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

projectseeker
Posts: 2
Joined: Wed Feb 24, 2021 12:18 pm

Python access to eviews databases

Postby projectseeker » Wed Feb 24, 2021 12:23 pm

Hello,

In the pyeviews module there is an option to pull eviews workfiles into a pandas dataframe using pyeviews.GetWFAsPython. Is there a way of importing an eviews database file (".edb") into a pandas dataframe? Or can anyone think of a workaround for doing this?

Thanks

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Python access to eviews databases

Postby EViews Steve » Wed Feb 24, 2021 12:53 pm

There isn't a way to do it directly, but you can always create a workfile, open the EDB file, fetch the objects you want to the workfile, then get the workfile data. You would use the Run method to do all of the initial steps.

For example:

Code: Select all

evp.Run('WFCREATE A 1990 2000', app=eviewsapp)
evp.Run('DBOPEN mydb.edb', app=eviewsapp)
evp.Run('FETCH x y z', app=eviewsapp)
x = evp.GetWFAsPython(app=eviewsapp)

projectseeker
Posts: 2
Joined: Wed Feb 24, 2021 12:18 pm

Re: Python access to eviews databases

Postby projectseeker » Wed Feb 24, 2021 1:16 pm

Great, thank you.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Python access to eviews databases

Postby EViews Gareth » Wed Feb 24, 2021 1:46 pm

Be careful you keep frequencies the same - no error will occur if you create an annual workfile and fetch a quarterly series into it.
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 31 guests