pyeviews import from workfile
Posted: 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:
The output:
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