How to Remove duplicates from a Lookup File using Python? -


i've seen multiple responses around type of question, don't believe i've seen type of list concerned with. not duplicating here. appreciated!

i have comma separated file use data enrichment. starts headers - tpcode,corporation_name - list of values follows. there around 35k rows (if matters).

i notice when data lookup file (csv) displayed there multiple entries same customer. rather going in , manually removing them, run python script remove duplicates

in format of:

  • value,value
  • value,value
  • value,value

    etc., optimal way remove duplicates using python? side note, each tpcode should different, corp name can have multiple tpcodes.

please let me know if need additional information.

thanks in advance!

hard tell question if each line should unique. if do:

for l in sorted(set(line line in open('ors_1202.log'))):     print(l.rstrip()) 

otherwise need more info.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -