Skip to content

Instantly share code, notes, and snippets.

@westover
Last active October 5, 2015 20:12
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 westover/32dbf30881b384fa6dd6 to your computer and use it in GitHub Desktop.
Save westover/32dbf30881b384fa6dd6 to your computer and use it in GitHub Desktop.
import random
import csv
import re
data0 = []
target0 = []
with open('first.file') as th:
temp = th.readlines()
data2= [line.strip() for line in temp]
with open('second.file', 'rb) as tk:
# skip the first two lines
tk.readline()
tk.readline()
reader = csv.reader(tk, delimiter=' ')
for i, row in enumerate(reader):
row.append(data2[i])
data0.append(tuple(row))
print data0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment