Login  Register

Re: Deleting specific value labels

Posted by emma78 on Jun 18, 2015; 12:24pm
URL: http://spssx-discussion.165.s1.nabble.com/Deleting-specific-value-labels-tp5729847p5729860.html

Nobody has a value for those value label, We have special crossheadings  in our online suvey which unfortunately generates codes but nobody can click on those ;)


John , one last question:
What would it look like, if I wnat to search for a empty label? I tried none, blank but that doesn't seem to work.  Thank you!

begin program.
import spss, spssaux

vardict = spssaux.VariableDict()
for v in vardict:
    vallbls = v.ValueLabels
    for k, vl in vallbls.items():
        if vl == "no answer":
            del(vallbls[k])
            v.ValueLabels = vallbls
            break
end program.