码迷,mamicode.com
首页 > 其他好文 > 详细

测试12345

时间:2016-08-20 17:40:45      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

@function_performance_statistics(True)                                 # 装饰器
def cg_jx(log_route, dy, w_file, log_name, is_replace=False):
    act_route = get_route(w_file, log_name, dy)
    if not is_replace and os.path.exists(act_route.decode(‘utf-8‘)):
        return False
    index_name = [‘gain_time‘, ‘coin_type‘, ‘coin_num‘,
                  ‘reason_type‘, ‘template_type‘, ‘client_type‘]
    index_name_log = [‘,,‘+item+‘=‘ for item in index_name]
    cond_pat = ‘gain_time=%s.*?uid=\d+‘ % dy    # 前面不用加r
    pd_data = jiexi_two(log_route, dy, index_name_log, index_name, cond_pat)
    pd_data.to_csv(act_route.decode(‘utf-8‘), index=False)             # 写入
    return True

# 1_1
@function_performance_statistics(True)
def login_jx(log_route, dy, w_file, log_name, is_replace=False):
    act_route = get_route(w_file, log_name, dy)
    if not is_replace and os.path.exists(act_route.decode(‘utf-8‘)):
        return False
    index_name = [‘aid‘, ‘login_type‘]
    index_name_log = [‘,,‘+item+‘=‘ for item in index_name]
    cond_pat = ",,login_time=%s.*?,,isFirstLogin=1,," % dy
    pd_data = jiexi_two(log_route, dy, index_name_log, index_name, cond_pat, sep=‘,,‘)
    pd_data[‘login_time‘] = dy
    pd_data = pd_data.drop_duplicates(subset=[‘aid‘])
    pd_data.to_csv(act_route.decode(‘utf-8‘), index=False)
    return True

 

测试12345

测试12345

标签:

原文地址:http://www.cnblogs.com/wilson-love/p/5790685.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!