(T)
T = 0
    folder = 'trainT-0'
T = 0
    folder = 'trainT-0'
T = 0 folder = trainT - 0
def make(T):
    """
    T = 0
    folder = 'trainT-0'
    """
    if T==-1:
        folder = 'test'
    else:
        folder = 'trainT-'+str(T)
        
    log_ = pd.merge(log[log.order_number_rev>T], streak,
                    on=['order_id', 'product_id'], how='left')
    
    gr = log_.groupby('product_id')
    item = gr.streak.mean().to_frame()
    item.columns = ['item_streak_mean']
    
    item['item_streak_min'] = gr.streak.min()
    item['item_streak_max'] = gr.streak.max()
    item['item_streak_std'] = gr.streak.std()
    
    item.reset_index().to_pickle('../feature/{}/f210_product.p'.format(folder))
def make ( T ) : if T == - 1 : folder = 'test' else : folder = 'trainT-' + str ( T ) log_ = pd . merge ( log [ log . order_number_rev > T ] , streak , on = [ 'order_id' , 'product_id' ] , how = 'left' ) gr = log_ . groupby ( 'product_id' ) item = gr . streak . mean ( ) . to_frame ( ) item . columns = [ 'item_streak_mean' ] item [ 'item_streak_min' ] = gr . streak . min ( ) item [ 'item_streak_max' ] = gr . streak . max ( ) item [ 'item_streak_std' ] = gr . streak . std ( ) item . reset_index ( ) . to_pickle ( '../feature/{}/f210_product.p' . format ( folder ) )