SetVarNValueLabel Method (Python)
.SetVarNValueLabel(varName,value,label). Sets the value label of a single value for a new variable. The argument varName is a string specifying the name of a new numeric variable. The argument value is a numeric value and label is the string specifying the label for this value. Use the SetVarCValueLabel method to set value labels for new string variables.
- This method is only available in write mode.
Example
cur=spss.Cursor(accessType='w')
cur.SetVarNameAndType(['numvar'],[0])
cur.SetVarNValueLabel('numvar',1,'female')
cur.CommitDictionary()
cur.close()