SPSS 17 / Vista
Does anyone know where to find a list of all Python functions (for ex.: spss.GetVariableCount ...) with explanations (and if possible at least one example). The "Programming and Data Management for SPSS® Statistics 17.0" shows only a few examples. Thank you Frank
Dr. Frank Gaeth
|
Frank,
You can always open up an interactive session with Python (IDLE - which comes standard with the python distribution) and type the following (albeit combination based on your needs) python commands to "manually browse" (quick and dirty) any module. import spss dir(spss) # this looks quite messy sometimes, see the loop below for a cleaner example! for i in dir(spss): print i help(spss) ///// that will give you a list of all functions, classes, methods etc that exists in the spss module. Now you can take it a step further and type something like: dir(spss.exists) help(spss.exists) and go deeper into the module. You can keep going in deeper by appending to the string with the new method/function/class or whatever it is you are trying to find. This method of course is a brute-force type exploration, but often can yield some new features that you may not be aware of. Most of them I believe do NOT have examples, but if you ask on the listserv someone will always answer you. hth, J. R. Carroll Researcher for Hurtz Labs
Instructor at California State University, Sacramento
Research Methods, Test Development, and Statistics
Cell: 916 628-4204
Email: [hidden email]
On Sun, Mar 6, 2011 at 12:02 PM, drfg2008 <[hidden email]> wrote: SPSS 17 / Vista |
thank you for your help!
Dr. Frank Gaeth
|
In reply to this post by drfg2008
When you install the Python Essentials
or plugin, the complete documentation for the core apis is installed and
appears on the Help menu. There is one set of apis for programmability
(the spss module), and another set for scripting (the SpssClient module).
For other modules and extensions, you need to look on the SPSS Community site (www.ibm.com/developerworks/spssdevcentral). All the extension commands with short summaries are listed in the Extension Commands section. There are also sections for Python utility functions, statistical functions, R etc. Some of the Python modules have many functions (especially spssaux and spssaux2). For those, you need to download the module and look at the documentation within it. Each function has a docstring following the def statement that describes what it does and what the parameters are. There are various tools that can harvest the doc strings and produce nice html docs; I'm working on a better way to update that cross-module doc. But for now, you can do this, for example, import spssaux help(spssaux) That will display all the doc strings in the module as plain text. HTH, Jon Peck Senior Software Engineer, IBM [hidden email] 312-651-3435 From: drfg2008 <[hidden email]> To: [hidden email] Date: 03/06/2011 01:05 PM Subject: [SPSSX-L] list of python functions Sent by: "SPSSX(r) Discussion" <[hidden email]> SPSS 17 / Vista Does anyone know where to find a list of all Python functions (for ex.: spss.GetVariableCount ...) with explanations (and if possible at least one example). The "Programming and Data Management for SPSS® Statistics 17.0" shows only a few examples. Thank you Frank ----- FUB -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/list-of-python-functions-tp3411704p3411704.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
In reply to this post by J. R. Carroll
In addition, a list of all the functions of the spss module is given in the appendix of the Data Management book (p. 361 of the 3rd edition). Cheers!!Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: Justin Carroll <[hidden email]> To: [hidden email] Sent: Sun, March 6, 2011 10:02:59 PM Subject: Re: [SPSSX-L] list of python functions Frank, You can always open up an interactive session with Python (IDLE - which comes standard with the python distribution) and type the following (albeit combination based on your needs) python commands to "manually browse" (quick and dirty) any module. import spss dir(spss) # this looks quite messy sometimes, see the loop below for a cleaner example! for i in dir(spss): print i help(spss) ///// that will give you a list of all functions, classes, methods etc that exists in the spss module. Now you can take it a step further and type something like: dir(spss.exists) help(spss.exists) and go deeper into the module. You can keep going in deeper by appending to the string with the new method/function/class or whatever it is you are trying to find. This method of course is a brute-force type exploration, but often can yield some new features that you may not be aware of. Most of them I believe do NOT have examples, but if you ask on the listserv someone will always answer you. hth, J. R. Carroll Researcher for Hurtz Labs
Instructor at California State University, Sacramento
Research Methods, Test Development, and Statistics
Cell: 916 628-4204
Email: [hidden email]
On Sun, Mar 6, 2011 at 12:02 PM, drfg2008 <[hidden email]> wrote: SPSS 17 / Vista |
Free forum by Nabble | Edit this page |