features_generator.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:JData-algorithm-competition 作者: wrzto 项目源码 文件源码
def load_base_item_feat(end_date = '2016/4/16'):
    '''
    ??????
    '''
    JComment = pd.read_csv(COMMENT_FILE, encoding='gbk')
    end_date = pd.to_datetime(end_date)
    JComment.dt = pd.to_datetime(JComment.dt)
    dts = JComment.dt.drop_duplicates()
    dts.sort_index(inplace=True, ascending=False)
    for dt in dts.iteritems():
        if dt[-1] < end_date:
            break
    JComment = JComment[JComment.dt == dt[-1]].drop(['dt'], axis=1)
    Comment_num_dummies = pd.get_dummies(JComment.comment_num, prefix='Comment_num')
    JComment = pd.concat([JComment, Comment_num_dummies], axis=1)

    return JComment.drop(['comment_num'], axis=1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号