コード例 #1
0
if DOWNLOAD_pyPNAD is True:
    import urllib.request
    urllib.request.urlretrieve(
        "https://raw.githubusercontent.com/omercadopopular/cgoes/master/tinyapps/pyPNAD/pyPNAD.py",
        "pyPNAD.py")

# Import pyPNAD, load PNAD Contínua data from raw text file and SAS dictionary

if IMPORTRAW is True:
    from pyPNAD import pyPNAD

    DATAFILE = PATH + 'PNADC_032012.txt'
    INPUTFILE = PATH + 'Input_PNADC_trimestral.txt'
    CSVFILE = PATH + 'PNADC_032012.csv'

    DF = pyPNAD.load(DATAFILE, INPUTFILE)

    DF.to_csv(CSVFILE)

###############
# IMPORT DATA #
###############

# Import from csv

DF = pd.read_csv(CSVFILE)

###################
# PREPARE DATASET #
###################
コード例 #2
0
if DOWNLOAD_pyPNAD is True:
    import urllib.request
    urllib.request.urlretrieve("https://raw.githubusercontent.com/omercadopopular/cgoes/master/tinyapps/pyPNAD/pyPNAD.py",
                               "pyPNAD.py")

# Import pyPNAD, load PNAD Contínua data from raw text file and SAS dictionary

if IMPORTRAW is True:
    from pyPNAD import pyPNAD
      
    DATAFILE = PATH + 'PNADC_032012.txt'
    INPUTFILE = PATH + 'Input_PNADC_trimestral.txt'
    CSVFILE = PATH + 'PNADC_032012.csv'
    
    DF = pyPNAD.load(DATAFILE, INPUTFILE)
    
    DF.to_csv(CSVFILE)

###############
# IMPORT DATA #
###############

# Import from csv
    
DF = pd.read_csv(CSVFILE)

###################
# PREPARE DATASET #
###################