After downloading a .tab file, I am trying to convert it into a pandas df but it looks very strange when I run this line of code:
df = pd.read_csv('/Users/me/HUMAN_9606_idmapping_selected.tab', sep ='\t', nrows=10)
How can I convert it to look like a regular df?
CodePudding user response:
You don't even need to extract it, looks like you don't have a header, so you should specify header=None
:
df = pd.read_csv('HUMAN_9606_idmapping_selected.tab.gz', sep='\t', header=None)
# OR
df = pd.read_table('HUMAN_9606_idmapping_selected.tab.gz', header=None)