美文网首页
各种文件操作txt, csv

各种文件操作txt, csv

作者: 啊啊啊啊啊1231 | 来源:发表于2020-03-24 13:31 被阅读0次

csv文件的打开:

def load_csv_data(train_data_path):

    result = []

    with open(train_data_path,'r') as fp:

        for line in fp:

            t = line.strip().split(',')

            t = [int(i) for i in t]

            result.append(t)

    return result

相关文章

网友评论

      本文标题:各种文件操作txt, csv

      本文链接:https://www.haomeiwen.com/subject/pdsoyhtx.html