pyeviews import from workfile

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

troy_walters
Posts: 20
Joined: Thu Jan 15, 2015 9:07 am

pyeviews import from workfile

Postby troy_walters » Thu Sep 06, 2018 1:07 pm

I am attempting to import data into python from an EViews workfile using the pyeviews module. When doing so, the resulting object is a DataFrame where one column contains the imported series and another column is all NaNs with a column name of type 'bytes' rather than type 'string'. I am not certain, but this does not seem to be the expected behavior. I am using the anaconda install of pyeviews and I am getting the below issue in both EViews 9 and EViews 10. Here is a simple reproducible example:

Code: Select all

import numpy as np import pandas as pd import pyeviews as evp eviewsapp = evp.GetEViewsApp(instance='new', showwindow=True) index = pd.date_range('1990', periods=28, freq='A') test_series = pd.Series(np.random.normal(size=28), index=index, name='test_series') evp.PutPythonAsWF(test_series, app=eviewsapp) return_series = evp.GetWFAsPython(app=eviewsapp, pagename='Untitled', namefilter='test_series') eviewsapp.Hide() eviewsapp = None evp.Cleanup() print(return_series)

The output:

Code: Select all

b'TEST_SERIES' TEST_SERIES 1990-01-01 NaN 1.856871 1991-01-01 NaN 1.381807 1992-01-01 NaN -1.546430 1993-01-01 NaN -1.495575 1994-01-01 NaN -1.480186 1995-01-01 NaN 1.013788 1996-01-01 NaN -0.860026 1997-01-01 NaN -0.820417 1998-01-01 NaN 0.231626 1999-01-01 NaN -0.698038 2000-01-01 NaN 1.628136 2001-01-01 NaN -0.294297 2002-01-01 NaN -2.163224 2003-01-01 NaN 1.054671 2004-01-01 NaN 2.320408 2005-01-01 NaN -0.823228 2006-01-01 NaN 1.331298 2007-01-01 NaN -0.204163 2008-01-01 NaN 0.117109 2009-01-01 NaN -1.644645 2010-01-01 NaN 0.626800 2011-01-01 NaN 0.366524 2012-01-01 NaN 1.675069 2013-01-01 NaN -1.959929 2014-01-01 NaN 0.629066 2015-01-01 NaN 1.076807 2016-01-01 NaN 1.267009 2017-01-01 NaN -0.420320

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: pyeviews import from workfile

Postby EViews Rebecca » Tue Sep 11, 2018 2:03 pm

Which version of python are you using?

troy_walters
Posts: 20
Joined: Thu Jan 15, 2015 9:07 am

Re: pyeviews import from workfile

Postby troy_walters » Wed Sep 12, 2018 7:26 am

Sorry, Python 3.6.5 :: Anaconda, Inc.

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: pyeviews import from workfile

Postby EViews Rebecca » Fri Sep 14, 2018 5:32 pm

It's a little buried in the documentation, but pyeviews is designed for Python 2. You'll get unexpected behavior if you use 3.

troy_walters
Posts: 20
Joined: Thu Jan 15, 2015 9:07 am

Re: pyeviews import from workfile

Postby troy_walters » Wed Sep 19, 2018 6:50 am

Ok thanks. Are there any plans for updating to package to python 3?

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: pyeviews import from workfile

Postby EViews Rebecca » Wed Sep 19, 2018 7:27 am

Yes, but not in the immediate future.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests