Initializing help system before first use

pyinitpandas

pyinitpandas


Purpose
Set pyusepandas parameter to true and initialize the pandas interface.
Synopsis
procedure pyinitpandas
Example
The following example first prints a Mosel array as Python dictionary and then initializes the pandas interface and prints the array as pandas Series:
declarations
    A: array(range) of real
end-declarations

A :: (-1..2)[-1.1, 0, 1.1, 2.2]
pycallvoid("print", "A as Python dict:\n", A)
pyinitpandas
pycallvoid("print", "A as pandas Series:\n", A)
Further information
1. This procedure is equivalent to the following two commands:
setparam("pyusepandas", true)
pyinit
See the documentation of pyusepandas and pyinit for further information. The I/O Driver python section provides an overview of the additionally available type mappings after having initialized the pandas interface.
2. At first, the procedure sets the parameter pyusepandas to true, then it initializes the Python interpreter if it has not yet been initialized and finally it initializes the pandas interface if it has not yet been initialized. Once initialized, the pandas functionality will continue to be available even after switching pyusepandas off. See pyusepandas for more information.
Related topics
Module
python3