How do I read this and return its tabular form?

Viewed 17

Heyo smart peeps, I am tasked at my Co-Op with creating an app to automate data analysis and the text files they provide are a bit finicky. They claim they are in tabular form, and it looks like it, but my codes aren't working for some reason. Keep in mind that I am a novice, but I asked for a coding project because I know its something I need to learn. Anyways, below is a snippet of the top of the text file, and my simple, erroneous code. Thank you!

text file data

import numpy as np
filename = 'PS.prg1903-001_KSK_LB__0_00001.txt' 
data = np.loadtxt(filename, delimiter=',', skiprows=1, dtype=str)

print(data)

This is the error message:

ValueError: Wrong number of columns at line 6
0 Answers
Related