run.py 文件源码

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

项目:twitter_mongodb_helper 作者: IDEA-NTHU-Taiwan 项目源码 文件源码
def count_entries(file_list):
    """Performs a count of the number of number of words in the corpus
     Args:
        file_list  (list): list of file names.

    Returns:
        list: A list of json objects containing the count per file name
    """
    result = []
    for obj in file_list:
        with open(CSV_PATH + obj + '.csv', "r") as entry:
            reader = csv.reader(entry, delimiter=",")
            col_count = len(reader.next())
            res = {"Filename": obj, "Count": col_count}
            result.append(res)
    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号