Skip to content

Python script to sort the 02598 survey data into a python dictionary based on a textual codebook containing over 2,500 variables, and the option to output data as a csv file

Notifications You must be signed in to change notification settings

paulmikulskis/02598-codebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

02598-codebook

This is a Python3 script that will read the data from the Survey of Inmates in State and Federal Correctional Facilities, 1997.

What This Script is Good For
  • Exporting data from the 02958 survey into a csv format for use with R or any other data program
  • If you are using Python, this script stores the processed data in a dictionary structure, which is easy to use.
Usage Notes
  • To use the script, download the data in text file format from the survey link, and put it into a folder with this script and the codebook text file. To run the script, open up a terminal and run the command ./sort.py.
  • If permission is denied when you try to run the file, run the command sudo chmod 777 sort.py before running the file to fix.
  • When the script is run, it will prompt some questions about what variables in what areas to extract into CSV format for the sake of saving space. If you want to extract all data, press enter on each step.
  • This script only extracts the first 2,085 variables that have numerical answers.

About

Python script to sort the 02598 survey data into a python dictionary based on a textual codebook containing over 2,500 variables, and the option to output data as a csv file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages