Why Python reads columns of the .txt as a single column?

86 Views Asked by At

I've just started learning Python and I need to open the dataset. The file is .txt. The problem is when I read the file, Python merges all its columns into one.

The original txt looks like this:

this

I write the code in the Jupyter-notebook.

datareader = pd.read_csv ('data.txt', delimiter=None, header=[1,2])
datareader

Python output looks like this:

this

What am I doing wrong? How to open the data correctly?

0

There are 0 best solutions below