Skip to content

Instantly share code, notes, and snippets.

@Thuruv
Created December 10, 2014 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thuruv/841a224e26f74dad3f19 to your computer and use it in GitHub Desktop.
Save Thuruv/841a224e26f74dad3f19 to your computer and use it in GitHub Desktop.
Code to Comparison Making for DE
__author__ = 'c_thv'
#path = 'c:/users/c_thv/desktop/ban.csv'
import csv
#print result[0][1] #row number and the col like RC style
infile=(list(csv.reader(open('c:/users/c_thv/desktop/ban.csv',"rb")))) #loading the file in numpy
x = dict([(row[0], row[1:]) for row in infile]) #Devlop a dict as InFile
outfile=(list(csv.reader(open('c:/users/c_thv/desktop/thi.csv',"rb"))))
y = dict([(row[0], row[1:]) for row in outfile]) #Devlop a dict as OutFile
for i in x.keys(): #Basic String Comparison With reference to the Keys
if str(i) in y.keys():
h = y[i]
result =(csv.writer(open('www.csv','w')))
result.writerow(["Price", "Id 1", "peLink 2"]) #Headers starting from second Column
for k in (x.keys()):
result.writerow(y[k])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment