Skip to content

Instantly share code, notes, and snippets.

Created May 10, 2017 08:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/6eae9c8a2af454e2b7499be282ab05b6 to your computer and use it in GitHub Desktop.
# Place the Python script (answer.py) in the same directory as your file (input.tsv)
# Run the script from the command-line with the following command:
# >>> python3 answer.py
import csv
with open('input.tsv') as handle:
reader = csv.reader(handle, delimiter='\t')
header = next(reader)
print('\t'.join(header[0:2]))
for row in reader:
pos = row[0]
row = row[1:]
for col in row:
print(pos, col)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment