Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas module in SPSS Modeler

I need to put a certain code developed in Python 3 into a SPSS Modeler node (using the Extension Transform node). This code uses pandas and the default installation of Modeler doesn't include this module.

I tried to make SPSS to point to my own Python installation (which includes pandas module) by modifying the 'options.cfg' file following these instructions:

https://www.ibm.com/support/knowledgecenter/en/SS3RA7_sub/modeler_r_nodes_ddita/clementine/r_pyspark_api.html

However, when I try to import pandas inside SPSS Modeler, it isn't able to load the module. In fact I am not able to load pyspark neither by writing:

import spss.pyspark

Also when I try to see the directory of the python executable:

import sys print sys.executable

SPSS gives back a 'None' value.

How can I get to work pandas in SPSS Modeler? It seems that I am not able to import any module in Modeler. I am a beginner in SPSS so any help would be appreciated.

like image 734
Pacullamen Avatar asked Feb 08 '18 14:02

Pacullamen


1 Answers

You can install new packages to your existing SPSS Modeler 18.1 Version by going to your installation path, e.g. "C:\Program Files\IBM\SPSS\Modeler\18.1" and then into the folder python. There you open a windows command shell in admin mode. Now enter

python.exe -m pip install pandas

and it will install the library for SPSS to use.

like image 130
pandayo Avatar answered Oct 19 '22 17:10

pandayo