selectVars doesn't work
Issue #18
resolved
using selectVars has no effect; it does not create a selection of the variables in the file
savReader 3.3.0
from savReaderWriter import SavReader savfile = "employee data.sav" employee_sav = SavReader(savfile) selection = SavReader(savfile, selectVars=['gender', 'jobcat']) employee_sav.varNames selection.varNames selection == employee_sav
Comments (2)
-
repo owner -
repo owner - changed status to resolved
Resolved in commit 3bcdd72, also added unittest for this
- Log in to comment
Hi,
The code below works in Python 2 and 3 (Debian Linux x86-64). I did discover, however, a bug when a selection of just one variable is made (.e.g selectVars=['id']).
It was never my intention to let the selectVars setting propagate to all the meta data properties of the Header class (e.g varLabels, valueLabels, etc. etc.). It was supposed to speed up SavReader a little.