1

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?

Barmar
  • 741,623
  • 53
  • 500
  • 612
Polina
  • 11
  • 2

0 Answers0