parser_data.py 文件源码

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

项目:rl_trading 作者: ucaiado 项目源码 文件源码
def parse_header(self, l_data):
        '''
        Format the list of the header passe and return a dictionary

        :param l_data: list. list with the elements of the parsed row
        '''
        d_rtn = {}
        # Name of file
        d_rtn['name_of_file'] = l_data[1]
        # Initial date of file
        d_rtn['initial_date'] = pd.to_datetime(l_data[2], format='%Y-%m-%d')
        d_rtn['initial_date'] = d_rtn['initial_date'].date()
        # End date of file
        d_rtn['end_date'] = pd.to_datetime(l_data[3], format='%Y-%m-%d')
        d_rtn['end_date'] = d_rtn['end_date'].date()
        # Contain the total of lines when the file Trailer record
        d_rtn['total_of_lines'] = int(l_data[4])

        return d_rtn
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号