コード例 #1
0
        'FiscalPrd', 'FiscalPrd2', 'CalPrdEndDate', 'Value_', 'FILLyr'
    ]
    re_qtr_samp = WS_resample(seq_DT, re_qtr, fill_cols=fill_cols)
    co_qtr_samp = WS_resample(seq_DT, co_qtr, fill_cols=fill_cols)
    oi_qtr_samp = WS_resample(seq_DT, oi_qtr, fill_cols=fill_cols)

    cm_qtr_samp = align_subtract(re_qtr_samp, co_qtr_samp)

    ol_qtr_samp = align_div(cm_qtr_samp, oi_qtr_samp)

    DF_ol_qtr = DF_ol_qtr.append(ol_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_ol_tot = substitute_Value(DF_ol_yr, DF_ol_qtr)
#*------------
firstCheck_duplicates(DF_ol_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_ol_tot = add_mapped_tick(DF_ol_tot, trim_codeMap)[cols]
DF_ol_tot['StyleName'] = 'OpLev'
#*------------
secondCheck_columns(DF_ol_tot)
#*------------
コード例 #2
0
    ni_qtr_samp = WS_resample(seq_DT, ni_qtr, fill_cols=fill_cols)
    rev_qtr_samp = WS_resample(seq_DT, rev_qtr, fill_cols=fill_cols)
    aa_qtr_samp = WS_resample(seq_DT, aa_qtr, fill_cols=fill_cols)

    cols = ['BASE_DT', 'Code', 'FiscalPrd', 'Value_']
    _acc_qtr_samp = align_subtract(cf_qtr_samp, ni_qtr_samp)
    accruals_qtr_samp = align_div(_acc_qtr_samp[cols], aa_qtr_samp)
    accrualsS_qtr_samp = align_div(_acc_qtr_samp[cols], rev_qtr_samp)

    DF_accruals_qtr = DF_accruals_qtr.append(accruals_qtr_samp, sort=False)
    DF_accrualsS_qtr = DF_accrualsS_qtr.append(accrualsS_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_accruals_tot = substitute_Value(DF_accruals_yr, DF_accruals_qtr)
DF_accrualsS_tot = substitute_Value(DF_accrualsS_yr, DF_accrualsS_qtr)
#*------------
firstCheck_duplicates(DF_accruals_tot, DF_accrualsS_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_accruals_tot = add_mapped_tick(DF_accruals_tot, trim_codeMap)[cols]
DF_accrualsS_tot = add_mapped_tick(DF_accrualsS_tot, trim_codeMap)[cols]

DF_accruals_tot['StyleName'] = 'Accruals'
コード例 #3
0
    

    # Quarter
    fill_cols = ['FiscalPrd', 'FiscalPrd2', 'CalPrdEndDate', 'Value_', 'FILLyr']
    gi_qtr_samp = WS_resample(seq_DT, gi_qtr, fill_cols=fill_cols)
    aa_qtr_samp = WS_resample(seq_DT, aa_qtr, fill_cols=fill_cols)

    gpoa_qtr_samp = align_div(gi_qtr_samp, aa_qtr_samp)
    gpoa_qtr_samp['Value_'] = gpoa_qtr_samp['Value_'] * 100

    DF_gpoa_qtr = DF_gpoa_qtr.append(gpoa_qtr_samp, sort=False)
    
    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_gpoa_tot = substitute_Value(DF_gpoa_yr, DF_gpoa_qtr)
#*------------
firstCheck_duplicates(DF_gpoa_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = ['BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
        'RGN_TP_CD', 'freq', 'ref']
DF_gpoa_tot = add_mapped_tick(DF_gpoa_tot, trim_codeMap)[cols]
DF_gpoa_tot['StyleName'] = 'GPOA'
#*------------
secondCheck_columns(DF_gpoa_tot)
#*------------
DF = DF_gpoa_tot
コード例 #4
0
    roe_yr_samp = WS_resample(seq_DT, roe_yr, fill_cols=fill_cols + ['FILLyr'])
    payout_yr_samp = WS_resample(seq_DT,
                                 payout_yr,
                                 fill_cols=fill_cols + ['FILLyr'])
    epsg_yr_samp = WS_resample(seq_DT,
                               epsg_yr,
                               fill_cols=fill_cols + ['Ratio'])

    DF_ROE_yr = DF_ROE_yr.append(roe_yr_samp, sort=False)
    DF_Payout_yr = DF_Payout_yr.append(payout_yr_samp, sort=False)
    DF_epsg_yr = DF_epsg_yr.append(epsg_yr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_ROE_trail = substitute_Value(DF_ROE_yr, DF_ROE_qtr)
DF_Payout_trail = substitute_Value(DF_Payout_yr, DF_Payout_qtr)
DF_epsg_trail = substitute_Value(DF_epsg_yr, DF_epsg_qtr)

DF_ROE_trail = DF_ROE_trail[DF_ROE_trail['Value_'].notnull()].sort_values(
    ['Code', 'BASE_DT']).copy()
DF_ROE_trail.loc[DF_ROE_trail['Value_'].abs() > 100,
                 'Value_'] = DF_ROE_trail.loc[
                     DF_ROE_trail['Value_'].abs() > 100,
                     'Value_'].apply(lambda x: 100 * np.sign(x))

DF_Payout_trail.loc[DF_Payout_trail['Value_'] < 0, 'Value_'] = np.nan
DF_Payout_trail = DF_Payout_trail[
    DF_Payout_trail['Value_'].notnull()].sort_values(['Code',
                                                      'BASE_DT']).copy()
DF_Payout_trail.loc[DF_Payout_trail['Value_'] > 100, 'Value_'] = 100
コード例 #5
0
                                             freq=freq,
                                             bkfil=bkfil)

    # <<< Trim Date >>>
    (ebitda2p_yr_samp,
     ebitda2p_qtr_samp) = (trimDateSeq(seq_DT, DF)
                           for DF in [ebitda2p_yr_samp, ebitda2p_qtr_samp])

    DF_ebitda2p_qtr = DF_ebitda2p_qtr.append(ebitda2p_qtr_samp, sort=False)
    DF_ebitda2p_yr = DF_ebitda2p_yr.append(ebitda2p_yr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_ebitda2p_tot = substitute_Value(DF_ebitda2p_yr,
                                   DF_ebitda2p_qtr,
                                   val_col='zValue_')
#*------------
firstCheck_duplicates(DF_ebitda2p_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_ebitda2p_tot = add_mapped_tick(DF_ebitda2p_tot, trim_codeMap)[cols]
DF_ebitda2p_tot['StyleName'] = '5YRel_EBITDA2P'
#*------------
secondCheck_columns(DF_ebitda2p_tot)
コード例 #6
0
        ['Code', 'BASE_DT', 'FiscalPrd', 'CalPrdEndDate'
         ]].drop_duplicates(), on=['Code', 'BASE_DT', 'FiscalPrd'], how='left')

    ro_qtr_samp = simple_mult(oi_qtr_samp, tax_qtr_samp).rename(columns={'FiscalPrd_0': 'FiscalPrd'})
    ic_qtr_samp = simple_subtract(aa_qtr_samp, c_qtr_samp).rename(columns={'FiscalPrd_0': 'FiscalPrd'})
    ic_qtr_samp = ic_qtr_samp[ic_qtr_samp['Value_'] > 0]

    roic_qtr_samp = align_div(ro_qtr_samp, ic_qtr_samp)
    roic_qtr_samp['Value_'] = roic_qtr_samp['Value_'] * 100

    DF_roic_qtr = DF_roic_qtr.append(roic_qtr_samp, sort=False)
    
    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_roic_tot = substitute_Value(DF_roic_yr, DF_roic_qtr)
#*------------
firstCheck_duplicates(DF_roic_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = ['BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
        'RGN_TP_CD', 'freq', 'ref']
DF_roic_tot = add_mapped_tick(DF_roic_tot, trim_codeMap)[cols]
DF_roic_tot['StyleName'] = 'ROIC'
#*------------
secondCheck_columns(DF_roic_tot)
#*------------
DF = DF_roic_tot
コード例 #7
0
    eba_qtr_samp = align_add(eb_qtr_samp, da_qtr_samp)
    fcf_qtr_samp = align_subtract(cf_qtr_samp, cx_qtr_samp)

    evebitda_qtr_samp = align_div(ev_qtr_samp, eba_qtr_samp)
    cfoev_qtr_samp = align_div(cf_qtr_samp, ev_qtr_samp)
    fcfev_qtr_samp = align_div(fcf_qtr_samp, ev_qtr_samp)

    DF_evebitda_qtr = DF_evebitda_qtr.append(evebitda_qtr_samp, sort=False)
    DF_cfoev_qtr = DF_cfoev_qtr.append(cfoev_qtr_samp, sort=False)
    DF_fcfev_qtr = DF_fcfev_qtr.append(fcfev_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_evebitda_tot = substitute_Value(DF_evebitda_yr, DF_evebitda_qtr)
DF_cfoev_tot = substitute_Value(DF_cfoev_yr, DF_cfoev_qtr)
DF_fcfev_tot = substitute_Value(DF_fcfev_yr, DF_fcfev_qtr)
#*------------
firstCheck_duplicates(DF_evebitda_tot, DF_cfoev_tot, DF_fcfev_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_evebitda_tot = add_mapped_tick(DF_evebitda_tot, trim_codeMap)[cols]
DF_cfoev_tot = add_mapped_tick(DF_cfoev_tot, trim_codeMap)[cols]
DF_fcfev_tot = add_mapped_tick(DF_fcfev_tot, trim_codeMap)[cols]
コード例 #8
0
    DF_ebitdam_yr_chg = DF_ebitdam_yr_chg.append(ebitdam_yr_chg_samp,
                                                 sort=False)

    DF_nm_qtr = DF_nm_qtr.append(nm_qtr_samp, sort=False)
    DF_opm_qtr = DF_opm_qtr.append(opm_qtr_samp, sort=False)
    DF_ebitdam_qtr = DF_ebitdam_qtr.append(ebitdam_qtr_samp, sort=False)

    DF_nm_qtr_chg = DF_nm_qtr_chg.append(nm_qtr_chg_samp, sort=False)
    DF_opm_qtr_chg = DF_opm_qtr_chg.append(opm_qtr_chg_samp, sort=False)
    DF_ebitdam_qtr_chg = DF_ebitdam_qtr_chg.append(ebitdam_qtr_chg_samp,
                                                   sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_nm_tot = substitute_Value(DF_nm_yr, DF_nm_qtr)
DF_opm_tot = substitute_Value(DF_opm_yr, DF_opm_qtr)
DF_ebitdam_tot = substitute_Value(DF_ebitdam_yr, DF_ebitdam_qtr)
DF_nm_chg_tot = substitute_Value(DF_nm_yr_chg, DF_nm_qtr_chg)
DF_opm_chg_tot = substitute_Value(DF_opm_yr_chg, DF_opm_qtr_chg)
DF_ebitdam_chg_tot = substitute_Value(DF_ebitdam_yr_chg, DF_ebitdam_qtr_chg)
#*------------
firstCheck_duplicates(DF_nm_tot, DF_opm_tot, DF_ebitdam_tot, DF_nm_chg_tot,
                      DF_opm_chg_tot, DF_ebitdam_chg_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
コード例 #9
0
    eq_qtr_samp = WS_resample(seq_DT, eq_qtr, fill_cols=fill_cols)
    mi_qtr_samp = WS_resample(seq_DT, mi_qtr, fill_cols=fill_cols)

    fcf_qtr_samp = align_subtract(cf_qtr_samp, cx_qtr_samp)
    ic_qtr_samp = align_add(db_qtr_samp, eq_qtr_samp, mi_qtr_samp)

    fcfroic_qtr_samp = align_div(fcf_qtr_samp, ic_qtr_samp)
    cfroic_qtr_samp = align_div(cf_qtr_samp, ic_qtr_samp)

    DF_fcfroic_qtr = DF_fcfroic_qtr.append(fcfroic_qtr_samp, sort=False)
    DF_cfroic_qtr = DF_cfroic_qtr.append(cfroic_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_cfroic_tot = substitute_Value(DF_cfroic_yr, DF_cfroic_qtr)
DF_fcfroic_tot = substitute_Value(DF_fcfroic_yr, DF_fcfroic_qtr)
#*------------
firstCheck_duplicates(DF_cfroic_tot, DF_fcfroic_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_cfroic_tot = add_mapped_tick(DF_cfroic_tot, trim_codeMap)[cols]
DF_fcfroic_tot = add_mapped_tick(DF_fcfroic_tot, trim_codeMap)[cols]
DF_cfroic_tot['StyleName'] = 'CFROIC'
DF_fcfroic_tot['StyleName'] = 'FCFROIC'
コード例 #10
0
    cfo2p_qtr_samp = Conv_Historical_Val3(cfo2p_qtr_samp,
                                          freq=freq,
                                          bkfil=bkfil)

    # <<< Trim Date >>>
    (cfo2p_yr_samp,
     cfo2p_qtr_samp) = (trimDateSeq(seq_DT, DF)
                        for DF in [cfo2p_yr_samp, cfo2p_qtr_samp])

    DF_cfo2p_qtr = DF_cfo2p_qtr.append(cfo2p_qtr_samp, sort=False)
    DF_cfo2p_yr = DF_cfo2p_yr.append(cfo2p_yr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_cfo2p_tot = substitute_Value(DF_cfo2p_yr, DF_cfo2p_qtr, val_col='zValue_')
#*------------
firstCheck_duplicates(DF_cfo2p_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_cfo2p_tot = add_mapped_tick(DF_cfo2p_tot, trim_codeMap)[cols]
DF_cfo2p_tot['StyleName'] = '5YRel_CFO2P'
#*------------
secondCheck_columns(DF_cfo2p_tot)
#*------------
コード例 #11
0
        ]])
    pfcf_DF_qtr = pd.merge(
        mktcap_DF.rename(columns={'Value_': 'mktcap'})[[
            'BASE_DT', 'Code', 'mktcap'
        ]],
        pfcf_DF_qtr.rename(columns={
            'Value_0': 'CFO',
            'Value_1': 'Capex',
            'Value_': 'FCF'
        }),
        on=['BASE_DT', 'Code'])
    pfcf_DF_qtr['Value_'], pfcf_DF_qtr[
        'freq'] = pfcf_DF_qtr['mktcap'] / pfcf_DF_qtr['FCF'], 'Q'

    # <<P2Sales>>
    ps_DF = substitute_Value(ps_DF_yr, ps_DF_qtr).copy()
    ps_DF = ps_DF[['BASE_DT', 'Code', 'freq', 'Value_']]
    ps_DF['Item'], ps_DF['Name'] = np.nan, 'PS_curr'
    ps_DF = ps_DF[(~ps_DF['Value_'].isin([np.Inf, -np.Inf]))
                  & ps_DF['Value_'].notnull()]
    pfcf_DF = substitute_Value(pfcf_DF_yr, pfcf_DF_qtr).copy()
    pfcf_DF = pfcf_DF[['BASE_DT', 'Code', 'freq', 'Value_']]
    pfcf_DF['Item'], pfcf_DF['Name'] = np.nan, 'PFCF_curr'
    pfcf_DF = pfcf_DF[(~pfcf_DF['Value_'].isin([np.Inf, -np.Inf]))
                      & pfcf_DF['Value_'].notnull()]

    TMP = reduce(lambda x, y: pd.DataFrame.append(x, y, sort=True),
                 [pe_DF, pb_DF, dy_DF, pc_DF, roe_DF, payout_DF, mktcap_DF])
    TMP['freq'] = 'curr'
    DF_Value = reduce(lambda x, y: pd.DataFrame.append(x, y, sort=True),
                      [DF_Value, TMP, ps_DF, pfcf_DF])
コード例 #12
0
    fill_cols = [
        'FiscalPrd', 'FiscalPrd2', 'CalPrdEndDate', 'Value_', 'FILLyr'
    ]
    d_qtr_samp = WS_resample(seq_DT, d_qtr, fill_cols=fill_cols)
    e_qtr_samp = WS_resample(seq_DT, e_qtr, fill_cols=fill_cols)

    cols = ['BASE_DT', 'Code', 'FiscalPrd', 'Value_']
    de_qtr_samp = align_div(d_qtr_samp, e_qtr_samp)
    de_qtr_samp = de_qtr_samp[de_qtr_samp['Value_'] >= 0]

    DF_de_qtr = DF_de_qtr.append(de_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_de_tot = substitute_Value(DF_de_yr, DF_de_qtr)
#*------------
firstCheck_duplicates(DF_de_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_de_tot = add_mapped_tick(DF_de_tot, trim_codeMap)[cols]
DF_de_tot['StyleName'] = 'LTDtE'
#*------------
secondCheck_columns(DF_de_tot)
#*------------
コード例 #13
0
    NIgr_qtr_samp = WS_resample(seq_DT, NIgr_qtr, fill_cols=fill_cols)
    DtE_qtr_samp = WS_resample(seq_DT, DtE_qtr, fill_cols=fill_cols)

    DF_ROE_qtr = DF_ROE_qtr.append(roe_qtr_samp, sort=False)
    DF_ROA_qtr = DF_ROA_qtr.append(roa_qtr_samp, sort=False)
    DF_OPM_qtr = DF_OPM_qtr.append(opm_qtr_samp, sort=False)
    DF_NM_qtr = DF_NM_qtr.append(nm_qtr_samp, sort=False)
    DF_GPM_qtr = DF_GPM_qtr.append(gpm_qtr_samp, sort=False)
    DF_RevGr_qtr = DF_RevGr_qtr.append(REVgr_qtr_samp, sort=False)
    DF_NIGr_qtr = DF_NIGr_qtr.append(NIgr_qtr_samp, sort=False)
    DF_DtE_qtr = DF_DtE_qtr.append(DtE_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_ROE_tot = substitute_Value(DF_ROE_yr, DF_ROE_qtr)
DF_ROA_tot = substitute_Value(DF_ROA_yr, DF_ROA_qtr)
DF_OPM_tot = substitute_Value(DF_OPM_yr, DF_OPM_qtr)
DF_NM_tot = substitute_Value(DF_NM_yr, DF_NM_qtr)
DF_GPM_tot = substitute_Value(DF_GPM_yr, DF_GPM_qtr)
DF_RevGr_tot = substitute_Value(DF_RevGr_yr, DF_RevGr_qtr)
DF_NIGr_tot = substitute_Value(DF_NIGr_yr, DF_NIGr_qtr)
DF_DtE_tot = substitute_Value(DF_DtE_yr, DF_DtE_qtr)
#*------------
firstCheck_duplicates(DF_ROE_tot, DF_ROA_tot, DF_OPM_tot, DF_NM_tot,
                      DF_GPM_tot, DF_RevGr_tot, DF_NIGr_tot, DF_DtE_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
コード例 #14
0
        'FiscalPrd', 'FiscalPrd2', 'CalPrdEndDate', 'Value_', 'FILLyr'
    ]
    cf_qtr_samp = WS_resample(seq_DT, cf_qtr, fill_cols=fill_cols)
    dv_qtr_samp = WS_resample(seq_DT, dv_qtr, fill_cols=fill_cols)
    cx_qtr_samp = WS_resample(seq_DT, cx_qtr, fill_cols=fill_cols)

    cols = ['BASE_DT', 'Code', 'FiscalPrd', 'Value_']
    cc_qtr_samp = align_add(cf_qtr_samp, dv_qtr_samp)
    cacqr_qtr_samp = align_div(cc_qtr_samp[cols], cx_qtr_samp)

    DF_CAcqR_qtr = DF_CAcqR_qtr.append(cacqr_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_CAcqR_tot = substitute_Value(DF_CAcqR_yr, DF_CAcqR_qtr)
#*------------
firstCheck_duplicates(DF_CAcqR_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_CAcqR_tot = add_mapped_tick(DF_CAcqR_tot, trim_codeMap)[cols]
DF_CAcqR_tot['StyleName'] = 'CAcqR'
#*------------
secondCheck_columns(DF_CAcqR_tot)
#*------------
コード例 #15
0
    fill_cols = [
        'FiscalPrd', 'FiscalPrd2', 'CalPrdEndDate', 'Value_', 'FILLyr'
    ]
    ac_qtr_samp = WS_resample(seq_DT, ac_qtr, fill_cols=fill_cols)
    rev_qtr_samp = WS_resample(seq_DT, rev_qtr, fill_cols=fill_cols)

    cols = ['BASE_DT', 'Code', 'FiscalPrd', 'Value_']
    ardays_qtr_samp = align_div(ac_qtr_samp, rev_qtr_samp)
    ardays_qtr_samp['Value_'] = -1 * ardays_qtr_samp['Value_'] * 365

    DF_ardays_qtr = DF_ardays_qtr.append(ardays_qtr_samp, sort=False)

    batch_monitor_msg(i, tot_n, st_time)
batch_finish_msg(tot_n, st_time)

DF_ardays_tot = substitute_Value(DF_ardays_yr, DF_ardays_qtr)
#*------------
firstCheck_duplicates(DF_ardays_tot)
#*------------
# Map Code -> TMSRS_CD
# Should customize columns by needed ones.
# MUST HAVE 'BASE_DT', 'TMSRS_CD', 'Code', 'Value_', 'RGN_TP_CD', 'freq'
cols = [
    'BASE_DT', 'TMSRS_CD', 'Code', 'Value_yr', 'Value_qtr', 'Value_',
    'RGN_TP_CD', 'freq', 'ref'
]
DF_ardays_tot = add_mapped_tick(DF_ardays_tot, trim_codeMap)[cols]
DF_ardays_tot['StyleName'] = 'ARDays'
#*------------
secondCheck_columns(DF_ardays_tot)
#*------------