Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open a .tsv file in Jupyter? Jupyter.Notebook tried suggestions, but it doesn't work

How can I open a .tsv file in Jupyter.
The data is stored under C:/User/anna/.

This is my code:

import pandas as pd
df=pd.read_csv('C:/User/anna/train')

But I get this error message:

FileNotFoundError: File b'C:/Users/anna/train.txt' does not exist

like image 506
WJ Zhao Avatar asked Oct 27 '25 14:10

WJ Zhao


1 Answers

it's actually to do with pandas, by default the separator is comma, not tab. try the code below:

df=pd.read_csv('C:/User/anna/train', sep='\t')
like image 67
HappyBambi Avatar answered Oct 29 '25 12:10

HappyBambi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!