External Interfaces
Python Connectivity
EViews 12 offers bi-directional communication between EViews and the Python programming language.
Previously, the communication between the EViews and Pyton was only in one-direction as the freely available pyeviews package allowed you call EViews from your Python program, but there was no direct support for Python from within EViews.
EViews 12 now allow you to use Python packages and code from within EViews.
Python From EViews
EViews 12 allows you to use Python packages and code from within EViews to improve your workflow. Similar to EViews 10’s integration with Matlab® and R, with EViews 12 you can send EViews data into the Python environment, execute Python functions, and then retrieve data back into EViews with simple commands.
EViews supports Python 2 (version 2.7.15 or greater) and Python 3 (version 3.6.5 or greater).
The syntax for the Python related xopen options is:
xopen(p)
or
xopen(type=p)
We support the following Python data types:
list
tuple
dictionary
numpy.ndarray
pandas.series
pandas.dataframe
The last three lines require the prior installation of the numpy and the pandas Python packages.
The syntax for Python related xput commands is therefore:
xput(ptype=list|tuple|dictionary|ndarray|series|dataframe)
EViews from Python
While the new python connectivity in EViews 12 allows you to call python from EViews, we remind you that the previously existing pyeviews package allows you to call EViews from Python. Similarly to the xopen command, once Python is started and pyeviews has been loaded (as evp in this example) you may open a connection to EViews with the command:
eviewsapp = evp.GetEViewsApp(instance='new', showwindow=True)
Analogous to the xput command, data (in this case a series) may be transferred from Python to EViews with the command:
evp.PutPythonAsWF(series, app=eviewsapp, newwf=False)
See the whitepaper
http://www.eviews.com/download/whitepapers/pyeviews.pdf for more information about the
pyeviews package.