Page 1 of 1

pyeviews import from workfile

Posted: Thu Sep 06, 2018 1:07 pm
by troy_walters
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

Re: pyeviews import from workfile

Posted: Tue Sep 11, 2018 2:03 pm
by EViews Rebecca
Which version of python are you using?

Re: pyeviews import from workfile

Posted: Wed Sep 12, 2018 7:26 am
by troy_walters
Sorry, Python 3.6.5 :: Anaconda, Inc.

Re: pyeviews import from workfile

Posted: Fri Sep 14, 2018 5:32 pm
by EViews Rebecca
It's a little buried in the documentation, but pyeviews is designed for Python 2. You'll get unexpected behavior if you use 3.

Re: pyeviews import from workfile

Posted: Wed Sep 19, 2018 6:50 am
by troy_walters
Ok thanks. Are there any plans for updating to package to python 3?

Re: pyeviews import from workfile

Posted: Wed Sep 19, 2018 7:27 am
by EViews Rebecca
Yes, but not in the immediate future.