zoukankan      html  css  js  c++  java
  • compareTool.py

    import csv
    import logging
    from DataCleaning.library.functions.changeDirectory import *
    from floatFormatter import *
    from DataCleaning.library.functions.addPath import *

    addPath("config")
    from config import *

    def compareTool():
    fname1 = "proof.csv"
    fname2 = outputFileName
    ind1 = [0, 1, 2]
    ind2 = [0, 1, 2]


    # read file proof.csv
    development2Proof()
    f = open(fname1, 'r', encoding='UTF-8')
    csvreader = csv.reader(f)
    file1 = list(csvreader)
    f.close()
    proof2Development()

    # read .txt file
    development2Processed()
    with open(fname2, "r", encoding='utf-8') as f:
    file2 = f.readlines()
    processed2Development()

    # create two empty sets
    set1 = set()
    set2 = set()

    # file 1
    for i in range(len(file1)):
    tempList = file1[i]
    tempList0 = []
    for j in ind1:
    tempElement = tempList[j]
    tempList0.append(tempElement)
    tempText = "|".join(tempList0)
    set1.add(tempText)

    # file 2
    for i in range(len(file2)):
    tempList = file2[i].strip(" ").split("|")
    tempList0 = []
    for j in ind2:
    tempElement = tempList[j]
    tempList0.append(tempElement)
    tempText = "|".join(tempList0)
    set2.add(tempText)
    return set1, set2  
  • 相关阅读:
    day20(顺时针打印矩阵)
    day18(树的子结构)
    JAVA WEB应用
    hexo 写作
    解决
    Github构建个人主页之写作
    Github构建个人主页之建站
    hive HQL数据库操作笔记02
    python scrapy爬虫笔记01
    spark笔记01
  • 原文地址:https://www.cnblogs.com/zhulimin/p/15369449.html
Copyright © 2011-2022 走看看