Why does pandas df show tsv's mandatory trailing-newline from pd.read_csv() as NaN?

180 Views Asked by At

My programming professor and the internet say I must always append exactly one empty line (=trailing newline) to all my output text files.

Why does

my_df = pd.read_csv('my.tsv', delimiter='\t', skip_blank_lines=True)

still read this \n into my pandas data frames and fills it with NaN values?

So far I have used df_no_nan = df.dropna(how="any", inplace=False).

enter image description here

What am I missing?

Is there a better solution?

Here the WeTransfer link to the file:

https://wetransfer.com/downloads/d34deac70e33a0a6351b8e4d6b4e3b8720210602143836/74fa00

0

There are 0 best solutions below