Created
May 10, 2017 08:17
Star
You must be signed in to star a gist
This file contains 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
# 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