Ejemplo n.º 1
0
_DATA_DIR = os.path.join(os.path.dirname(_CUR_DIR), "data")
_PRT_DIR = os.path.join(_DATA_DIR, "soi_partner")
# Importing custom modules:
import naics_processing as naics
import file_processing as fp
import constants as cst
# Dataframe names:
_INC_DF_NM = cst.INC_PRT_DF_NM
_AST_DF_NM = cst.AST_PRT_DF_NM
_TYP_DF_NM = cst.TYP_PRT_DF_NM
_TOT_CORP_DF_NM = cst.TOT_CORP_DF_NM
# (Optional) Hardcode the year that the partner data is from:
_YR = ""
_YR = str(_YR)
# Filenames:
_INC_IN_FILE = fp.get_file(dirct=_PRT_DIR, contains=[_YR+"pa01.xls"])
_AST_IN_FILE = fp.get_file(dirct=_PRT_DIR, contains=[_YR+"pa03.xls"])
_TYP_IN_FILE = fp.get_file(dirct=_PRT_DIR, contains=[_YR+"pa05.xls"])
_INC_IN_CROSS_FILE = fp.get_file(dirct=_PRT_DIR,
                                 contains=[_YR+"pa01_Crosswalk.csv"])
_AST_IN_CROSS_FILE = fp.get_file(dirct=_PRT_DIR,
                                 contains=[_YR+"pa03_Crosswalk.csv"])
_TYP_IN_CROSS_FILE = fp.get_file(dirct=_PRT_DIR,
                                 contains=[_YR+"pa05_Crosswalk.csv"])
_INC_OUT_FILE = _INC_DF_NM + ".csv"
_AST_OUT_FILE = _AST_DF_NM + ".csv"
_TYP_OUT_FILE = _TYP_DF_NM + ".csv"
# Full path for files:
_INC_IN_PATH = os.path.join(_PRT_DIR, _INC_IN_FILE)
_AST_IN_PATH = os.path.join(_PRT_DIR, _AST_IN_FILE)
_TYP_IN_PATH = os.path.join(_PRT_DIR, _TYP_IN_FILE)
Ejemplo n.º 2
0
_PROP_DIR = os.path.join(_DATA_DIR, "soi_proprietorship")
# Importing custom packages:
import naics_processing as naics
import file_processing as fp
import constants as cst
# Dataframe names:
_FARM_DF_NM = cst.FARM_PROP_DF_NM
_NFARM_DF_NM = cst.NON_FARM_PROP_DF_NM
_CODE_DF_NM = cst.CODE_DF_NM
_TOT_CORP_DF_NM = cst.TOT_CORP_DF_NM
_AST_PRT_DF_NM = cst.AST_PRT_DF_NM
# (Optional) Hardcode the year that the partner data is from:
_YR = ""
_YR = str(_YR)
# Filenames:
_DDCT_IN_FILE = fp.get_file(dirct=_PROP_DIR, contains=[_YR+"sp01br.xls"])
_FARM_IN_FILE = fp.get_file(dirct=_PROP_DIR, contains=["farm_data.csv"])
_DDCT_IN_CROSS_FILE = fp.get_file(dirct=_PROP_DIR,
                                  contains=[_YR+"sp01br_Crosswalk.csv"])
# Full path for files:
_DDCT_IN_PATH = os.path.join(_PROP_DIR, _DDCT_IN_FILE)
_FARM_IN_PATH = os.path.join(_PROP_DIR, _FARM_IN_FILE)
_DDCT_IN_CROSS_PATH = os.path.join(_PROP_DIR, _DDCT_IN_CROSS_FILE)
_NFARM_PROP_OUT_PATH = os.path.join(_OUT_DIR, _NFARM_DF_NM+".csv")
_FARM_PROP_OUT_PATH = os.path.join(_OUT_DIR, _FARM_DF_NM+".csv")
# Constant factors:
_DDCT_FILE_FCTR = 10**3
# Dataframe columns:
_NFARM_DF_COL_NMS = cst.DFLT_PROP_NFARM_DF_COL_NMS_DICT
_NFARM_DF_COL_NM = _NFARM_DF_COL_NMS["DEPR_DDCT"]
_AST_DF_COL_NMS_DICT = cst.DFLT_PRT_AST_DF_COL_NMS_DICT
Ejemplo n.º 3
0
_OUT_DIR = os.path.join(os.path.dirname(_CUR_DIR), "output")
_DATA_DIR = os.path.join(os.path.dirname(_CUR_DIR), "data")
_CORP_DIR = os.path.join(_DATA_DIR, "soi_corporate")
# Importing custom modules:
import naics_processing as naics
import file_processing as fp
import constants as cst
# Dataframe names:
_TOT_DF_NM = cst.TOT_CORP_DF_NM
_S_DF_NM = cst.S_CORP_DF_NM
_C_DF_NM = cst.C_CORP_DF_NM
# (Optional) Hardcode the year that the partner data is from:
_YR = ""
_YR = str(_YR)
# Filenames:
_TOT_CORP_IN_FILE = fp.get_file(dirct=_CORP_DIR, contains=[_YR+"sb1.csv"])
_S_CORP_IN_FILE = fp.get_file(dirct=_CORP_DIR, contains=[_YR+"sb3.csv"])
# Full path for files:
_TOT_CORP_IN_PATH = os.path.join(_CORP_DIR, _TOT_CORP_IN_FILE)
_S_CORP_IN_PATH = os.path.join(_CORP_DIR, _S_CORP_IN_FILE)
_TOT_CORP_OUT_PATH = os.path.join(_OUT_DIR, _TOT_DF_NM+".csv")
_S_CORP_OUT_PATH = os.path.join(_OUT_DIR, _S_DF_NM+".csv")
_C_CORP_OUT_PATH = os.path.join(_OUT_DIR, _C_DF_NM+".csv")
# Constant factors:
_TOT_CORP_IN_FILE_FCTR = 10**3
_S_CORP_IN_FILE_FCTR = 10**3
# Input--default dictionaries for df-columns to input-columns.
_DFLT_TOT_CORP_COLS_DICT = cst.DFLT_TOT_CORP_COLS_DICT
_DFLT_S_CORP_COLS_DICT = cst.DFLT_S_CORP_COLS_DICT
# Input--NAICS column:
_NAICS_COL_NM = "INDY_CD"
Ejemplo n.º 4
0
_DATA_DIR = os.path.join(os.path.dirname(_CUR_DIR), "data")
_PRT_DIR = os.path.join(_DATA_DIR, "soi_partner")
# Importing custom modules:
import naics_processing as naics
import file_processing as fp
import constants as cst
# Dataframe names:
_INC_DF_NM = cst.INC_PRT_DF_NM
_AST_DF_NM = cst.AST_PRT_DF_NM
_TYP_DF_NM = cst.TYP_PRT_DF_NM
_TOT_CORP_DF_NM = cst.TOT_CORP_DF_NM
# (Optional) Hardcode the year that the partner data is from:
_YR = ""
_YR = str(_YR)
# Filenames:
_INC_IN_FILE = fp.get_file(dirct=_PRT_DIR, contains=[_YR+"pa01.xls"])
_AST_IN_FILE = fp.get_file(dirct=_PRT_DIR, contains=[_YR+"pa03.xls"])
_TYP_IN_FILE = fp.get_file(dirct=_PRT_DIR, contains=[_YR+"pa05.xls"])
_INC_IN_CROSS_FILE = fp.get_file(dirct=_PRT_DIR,
                                 contains=[_YR+"pa01_Crosswalk.csv"])
_AST_IN_CROSS_FILE = fp.get_file(dirct=_PRT_DIR,
                                 contains=[_YR+"pa03_Crosswalk.csv"])
_TYP_IN_CROSS_FILE = fp.get_file(dirct=_PRT_DIR,
                                 contains=[_YR+"pa05_Crosswalk.csv"])
_INC_OUT_FILE = _INC_DF_NM + ".csv"
_AST_OUT_FILE = _AST_DF_NM + ".csv"
_TYP_OUT_FILE = _TYP_DF_NM + ".csv"
# Full path for files:
_INC_IN_PATH = os.path.join(_PRT_DIR, _INC_IN_FILE)
_AST_IN_PATH = os.path.join(_PRT_DIR, _AST_IN_FILE)
_TYP_IN_PATH = os.path.join(_PRT_DIR, _TYP_IN_FILE)
Ejemplo n.º 5
0
_PROP_DIR = os.path.join(_DATA_DIR, "soi_proprietorship")
# Importing custom packages:
import naics_processing as naics
import file_processing as fp
import constants as cst
# Dataframe names:
_FARM_DF_NM = cst.FARM_PROP_DF_NM
_NFARM_DF_NM = cst.NON_FARM_PROP_DF_NM
_CODE_DF_NM = cst.CODE_DF_NM
_TOT_CORP_DF_NM = cst.TOT_CORP_DF_NM
_AST_PRT_DF_NM = cst.AST_PRT_DF_NM
# (Optional) Hardcode the year that the partner data is from:
_YR = ""
_YR = str(_YR)
# Filenames:
_DDCT_IN_FILE = fp.get_file(dirct=_PROP_DIR, contains=[_YR + "sp01br.xls"])
_FARM_IN_FILE = fp.get_file(dirct=_PROP_DIR, contains=["farm_data.csv"])
_DDCT_IN_CROSS_FILE = fp.get_file(dirct=_PROP_DIR,
                                  contains=[_YR + "sp01br_Crosswalk.csv"])
# Full path for files:
_DDCT_IN_PATH = os.path.join(_PROP_DIR, _DDCT_IN_FILE)
_FARM_IN_PATH = os.path.join(_PROP_DIR, _FARM_IN_FILE)
_DDCT_IN_CROSS_PATH = os.path.join(_PROP_DIR, _DDCT_IN_CROSS_FILE)
_NFARM_PROP_OUT_PATH = os.path.join(_OUT_DIR, _NFARM_DF_NM + ".csv")
_FARM_PROP_OUT_PATH = os.path.join(_OUT_DIR, _FARM_DF_NM + ".csv")
# Constant factors:
_DDCT_FILE_FCTR = 10**3
# Dataframe columns:
_NFARM_DF_COL_NMS = cst.DFLT_PROP_NFARM_DF_COL_NMS_DICT
_NFARM_DF_COL_NM = _NFARM_DF_COL_NMS["DEPR_DDCT"]
_AST_DF_COL_NMS_DICT = cst.DFLT_PRT_AST_DF_COL_NMS_DICT
Ejemplo n.º 6
0
_OUT_DIR = os.path.join(os.path.dirname(_CUR_DIR), "output")
_DATA_DIR = os.path.join(os.path.dirname(_CUR_DIR), "data")
_CORP_DIR = os.path.join(_DATA_DIR, "soi_corporate")
# Importing custom modules:
import naics_processing as naics
import file_processing as fp
import constants as cst
# Dataframe names:
_TOT_DF_NM = cst.TOT_CORP_DF_NM
_S_DF_NM = cst.S_CORP_DF_NM
_C_DF_NM = cst.C_CORP_DF_NM
# (Optional) Hardcode the year that the partner data is from:
_YR = ""
_YR = str(_YR)
# Filenames:
_TOT_CORP_IN_FILE = fp.get_file(dirct=_CORP_DIR, contains=[_YR + "sb1.csv"])
_S_CORP_IN_FILE = fp.get_file(dirct=_CORP_DIR, contains=[_YR + "sb3.csv"])
# Full path for files:
_TOT_CORP_IN_PATH = os.path.join(_CORP_DIR, _TOT_CORP_IN_FILE)
_S_CORP_IN_PATH = os.path.join(_CORP_DIR, _S_CORP_IN_FILE)
_TOT_CORP_OUT_PATH = os.path.join(_OUT_DIR, _TOT_DF_NM + ".csv")
_S_CORP_OUT_PATH = os.path.join(_OUT_DIR, _S_DF_NM + ".csv")
_C_CORP_OUT_PATH = os.path.join(_OUT_DIR, _C_DF_NM + ".csv")
# Constant factors:
_TOT_CORP_IN_FILE_FCTR = 10**3
_S_CORP_IN_FILE_FCTR = 10**3
# Input--default dictionaries for df-columns to input-columns.
_DFLT_TOT_CORP_COLS_DICT = cst.DFLT_TOT_CORP_COLS_DICT
_DFLT_S_CORP_COLS_DICT = cst.DFLT_S_CORP_COLS_DICT
# Input--NAICS column:
_NAICS_COL_NM = "INDY_CD"