Where would I find FindEmptyVars

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Where would I find FindEmptyVars

Art Kendall
I went to the <Extensions><Extension Hub> and entered FindEmptyVars.
with all 3 State check boxes checked. and Select all checked.

"No extensions match the specified criteria."

I get the same message with very check box checked.  

If I click the link for Prerequisites it tells me the integration plug-in
for Python is installed.

begin program.
IMPORT spssaux2

spssaux2.FindEmptyVars()
end program.

points to the first "2" character and says "invalid syntax"



-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Where would I find FindEmptyVars

Jon Peck
FindEmptyVars is in the spssaux2.py module, which is installed with Statistics.  You got the error message because import must be in lower case.

Here is the documentation for FindEmptyVars (from the spssaux2.py module).

def FindEmptyVars(vars=None, delete=False, alpha=True):
    """Scan specified or all variables and determine which are missing or blank for all cases.  
    Return list of names and optionally delete those variables.
   
    vars is a list of the (zero-based) index numbers of the variables to check.
    It can also be a single string of blank-separated numbers or a VariableDict object.  
    By default, all  variables are checked.  
    A value is considered empty if it is sysmis or user missing.
    String variables are also considered empty if their values are all blank.
    delete specifies whether empty variables should be deleted or not.
    The return value is a possibly empty list of variable names, not index numbers.
   
    If alpha is False, string variables are excluded from the checked list.  This is true
    even if the variable was listed in the vars parameter.
   
    Examples:
    # find but do not delete the empty variables
    print FindEmptyVars()

    # use a VariableDict object and do the same thing
    vard = spssaux.VariableDict()
    print FindEmptyVars(vars=vard)
   
    # use a string of variable numbers and do the same thing but delete the empty variables
    strvars = []
    for v in vard:
        strvars.append(str(int(v)))
    strvars = " ".join(strvars)
    print FindEmptyVars(vars=strvars, delete=True)

On Fri, Mar 20, 2020 at 8:48 AM Art Kendall <[hidden email]> wrote:
I went to the <Extensions><Extension Hub> and entered FindEmptyVars.
with all 3 State check boxes checked. and Select all checked.

"No extensions match the specified criteria."

I get the same message with very check box checked. 

If I click the link for Prerequisites it tells me the integration plug-in
for Python is installed.

begin program.
IMPORT spssaux2

spssaux2.FindEmptyVars()
end program.

points to the first "2" character and says "invalid syntax"



-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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


--
Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Where would I find FindEmptyVars

Art Kendall
Thank you.



-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Where would I find FindEmptyVars

MLIves
In reply to this post by Jon Peck

I recently changed computers and had SPSS 27 and Python 3 installed—just after getting this to work with my previous setup.

Is there a FindEmptyVars for spssaux3.py?  How do I run this with my new set up?

 

begin program.

import spssaux2

print spssaux2.FindEmptyVars()

spssaux2.FindEmptyVars(delete=True)

end program.

 

I’ve already tried it with what seemed to be the recommended format.

begin program python3.

import spssaux3

print spssaux3.FindEmptyVars()

end program.

  File "<string>", line 3

    print spssaux3.FindEmptyVars()

          ^

SyntaxError: invalid syntax

 

 

Thanks!

Melissa

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Jon Peck
Sent: Friday, March 20, 2020 10:57 AM
To: [hidden email]
Subject: Re: [SPSSX-L] Where would I find FindEmptyVars

 

FindEmptyVars is in the spssaux2.py module, which is installed with Statistics.  You got the error message because import must be in lower case.

 

Here is the documentation for FindEmptyVars (from the spssaux2.py module).

 

def FindEmptyVars(vars=None, delete=False, alpha=True):
    """Scan specified or all variables and determine which are missing or blank for all cases.  
    Return list of names and optionally delete those variables.
   
    vars is a list of the (zero-based) index numbers of the variables to check.
    It can also be a single string of blank-separated numbers or a VariableDict object.  
    By default, all  variables are checked.  
    A value is considered empty if it is sysmis or user missing.
    String variables are also considered empty if their values are all blank.
    delete specifies whether empty variables should be deleted or not.
    The return value is a possibly empty list of variable names, not index numbers.
   
    If alpha is False, string variables are excluded from the checked list.  This is true
    even if the variable was listed in the vars parameter.
   
    Examples:
    # find but do not delete the empty variables
    print FindEmptyVars()

    # use a VariableDict object and do the same thing
    vard = spssaux.VariableDict()
    print FindEmptyVars(vars=vard)
   
    # use a string of variable numbers and do the same thing but delete the empty variables
    strvars = []
    for v in vard:
        strvars.append(str(int(v)))
    strvars = " ".join(strvars)
    print FindEmptyVars(vars=strvars, delete=True)

 

On Fri, Mar 20, 2020 at 8:48 AM Art Kendall <[hidden email]> wrote:

I went to the <Extensions><Extension Hub> and entered FindEmptyVars.
with all 3 State check boxes checked. and Select all checked.

"No extensions match the specified criteria."

I get the same message with very check box checked. 

If I click the link for Prerequisites it tells me the integration plug-in
for Python is installed.

begin program.
IMPORT spssaux2

spssaux2.FindEmptyVars()
end program.

points to the first "2" character and says "invalid syntax"



-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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


 

--

Jon K Peck
[hidden email]

===================== 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




This correspondence contains proprietary information some or all of which may be legally privileged; it is for the intended recipient only. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this correspondence and completely dispose of the correspondence immediately. Please notify the sender if you have received this email in error. NOTE: Messages to or from the State of Connecticut domain may be subject to the Freedom of Information statutes and regulations.

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Where would I find FindEmptyVars

Jon Peck
FindEmptyVars is still in spssaux2.  The 2 does not refer to the Python version.  This and other modules were converted to Python3 and are stored in the Python3 subdirectory under your Statistics installation.  They will be automatically used in a Python3 program.

The syntax error above comes from the most frequently appearing difference between Python 2 and Python 3.  print is now a function, not a statement, so you have to write
print(spssaux2.FindEmptyVars())

begin program python3. 
import spssaux2 
print(spssaux2.FindEmptyVars()) 
end program. 
['z']

On Tue, Oct 27, 2020 at 3:21 PM Ives, Melissa L <[hidden email]> wrote:

I recently changed computers and had SPSS 27 and Python 3 installed—just after getting this to work with my previous setup.

Is there a FindEmptyVars for spssaux3.py?  How do I run this with my new set up?

 

begin program.

import spssaux2

print spssaux2.FindEmptyVars()

spssaux2.FindEmptyVars(delete=True)

end program.

 

I’ve already tried it with what seemed to be the recommended format.

begin program python3.

import spssaux3

print spssaux3.FindEmptyVars()

end program.

  File "<string>", line 3

    print spssaux3.FindEmptyVars()

          ^

SyntaxError: invalid syntax

 

 

Thanks!

Melissa

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Jon Peck
Sent: Friday, March 20, 2020 10:57 AM
To: [hidden email]
Subject: Re: [SPSSX-L] Where would I find FindEmptyVars

 

FindEmptyVars is in the spssaux2.py module, which is installed with Statistics.  You got the error message because import must be in lower case.

 

Here is the documentation for FindEmptyVars (from the spssaux2.py module).

 

def FindEmptyVars(vars=None, delete=False, alpha=True):
    """Scan specified or all variables and determine which are missing or blank for all cases.  
    Return list of names and optionally delete those variables.
   
    vars is a list of the (zero-based) index numbers of the variables to check.
    It can also be a single string of blank-separated numbers or a VariableDict object.  
    By default, all  variables are checked.  
    A value is considered empty if it is sysmis or user missing.
    String variables are also considered empty if their values are all blank.
    delete specifies whether empty variables should be deleted or not.
    The return value is a possibly empty list of variable names, not index numbers.
   
    If alpha is False, string variables are excluded from the checked list.  This is true
    even if the variable was listed in the vars parameter.
   
    Examples:
    # find but do not delete the empty variables
    print FindEmptyVars()

    # use a VariableDict object and do the same thing
    vard = spssaux.VariableDict()
    print FindEmptyVars(vars=vard)
   
    # use a string of variable numbers and do the same thing but delete the empty variables
    strvars = []
    for v in vard:
        strvars.append(str(int(v)))
    strvars = " ".join(strvars)
    print FindEmptyVars(vars=strvars, delete=True)

 

On Fri, Mar 20, 2020 at 8:48 AM Art Kendall <[hidden email]> wrote:

I went to the <Extensions><Extension Hub> and entered FindEmptyVars.
with all 3 State check boxes checked. and Select all checked.

"No extensions match the specified criteria."

I get the same message with very check box checked. 

If I click the link for Prerequisites it tells me the integration plug-in
for Python is installed.

begin program.
IMPORT spssaux2

spssaux2.FindEmptyVars()
end program.

points to the first "2" character and says "invalid syntax"



-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.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


 

--

Jon K Peck
[hidden email]

===================== 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




This correspondence contains proprietary information some or all of which may be legally privileged; it is for the intended recipient only. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this correspondence and completely dispose of the correspondence immediately. Please notify the sender if you have received this email in error. NOTE: Messages to or from the State of Connecticut domain may be subject to the Freedom of Information statutes and regulations.

===================== 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


--
Jon K Peck
[hidden email]

===================== 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