(T)
T = 0
    folder = 'trainT-0'
T = 0
    folder = 'trainT-0'
T = 0 folder = trainT - 0
def multi(T):
    """
    T = 0
    folder = 'trainT-0'
    """
    if T==-1:
        folder = 'test'
    else:
        folder = 'trainT-'+str(T)
        
    label = pd.read_pickle('../feature/{}/label_reordered.p'.format(folder))
    df = pd.merge(label, order_tbl, on='order_id', how='left') 
    
    for i in tqdm(range(1, LOOP)):
        oid = 't-{}_order_id'.format(i)
        v = 't-{}_reordered'.format(i)
        log_ = log.rename(columns={'order_id':oid, 
                                   'reordered':v})[[oid, 'product_id', v]]
        df = pd.merge(df, log_, on=[oid, 'product_id'], how='left')
    
    col = ['order_id', 'product_id'] + [c for c in df.columns if '_reordered' in c]
    
    df[col].fillna(-1).to_pickle('../feature/{}/f302_order-product_all.p'.format(folder))
def multi ( T ) : if T == - 1 : folder = 'test' else : folder = 'trainT-' + str ( T ) label = pd . read_pickle ( '../feature/{}/label_reordered.p' . format ( folder ) ) df = pd . merge ( label , order_tbl , on = 'order_id' , how = 'left' ) for i in tqdm ( range ( 1 , LOOP ) ) : oid = 't-{}_order_id' . format ( i ) v = 't-{}_reordered' . format ( i ) log_ = log . rename ( columns = { 'order_id' : oid , 'reordered' : v } ) [ [ oid , 'product_id' , v ] ] df = pd . merge ( df , log_ , on = [ oid , 'product_id' ] , how = 'left' ) col = [ 'order_id' , 'product_id' ] + [ c for c in df . columns if '_reordered' in c ] df [ col ] . fillna ( - 1 ) . to_pickle ( '../feature/{}/f302_order-product_all.p' . format ( folder ) )