python pandas read_csv not recognizing \t in tab delimited file

Viewed 34958

I'm trying to read in the following tab separated data into pandas:
test.txt:

col_a\tcol_b\tcol_c\tcol_d
4\t3\t2\t1  
4\t3\t2\t1 

I import test.txt as follows:

pd.read_csv('test.txt',sep='\t')

The resulting dataframe has 1 column. The \t is not recognized as tab.

If I replace \t with a 'keyboard tab' the file is parsed correctly. I also tried replacing '\t with \t and /t and didn't have any luck.

Thanks in advance for your help.
Omar

PS: Screenshot http://imgur.com/a/nXvW3

1 Answers
Related