Skip to content

Instantly share code, notes, and snippets.

View mthipparthi's full-sized avatar

Mahesh Thipparthi mthipparthi

View GitHub Profile
@mthipparthi
mthipparthi / uniq_column.py
Last active November 9, 2015 00:46
Python : Finding Unique Eements in a column
# Best way to find uniqness in python is to apply set to any python datastructure
asin_list=[]
with open('3984875016745.txt') as input_file:
for line in input_file.readlines():
asin_list.append(list(line.split('\t'))[16])
asin_list.remove('asin1')
with open('asin_output.txt','w') as out_file:
for asin in list(set(asin_list)):
out_file.write(asin+'\n')