Created
December 10, 2014 01:19
-
-
Save Thuruv/841a224e26f74dad3f19 to your computer and use it in GitHub Desktop.
Code to Comparison Making for DE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__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