This is some simple Python code to download the open NHANES datasets to simplify the task of researchers. As Python is not a language I am using daily, there may be some issues with the code.
- Python
- Beautiful Soup Library
Python programming knowledge
Install Python and Beautiful Soup first
One can scrap data by adding into a python code:
import nhanesLoader as nl
from nhanesVariables import tests
testList=["THYROD","CBC"]
currentDir="C:\tmp\\"
csvFile='C:/output.csv'
nl.nhanesMergerNumpy(currentDir+"Nhanes\\",testList,dest=csvFile,all=True) #Scrape and creates CSV
df=nl.loadCSV(csvFile,ageMin=18,ageMax=25) #Load the created CSV file into a dataframe
Code is given as it is, with no assumption this will work. Feel free to contribute!
Distributed under the MIT License.