Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't parse the data #4

Open
JackKZ opened this issue Aug 23, 2022 · 0 comments
Open

Can't parse the data #4

JackKZ opened this issue Aug 23, 2022 · 0 comments

Comments

@JackKZ
Copy link

JackKZ commented Aug 23, 2022

I tried running the following code

`csv_nm ='./PRISMA/docs/data_single_csv/synthetic_dataset.csv'

with open(csv_nm, mode='rb') as file:
spectra, spectra_metadata = prisma.parsers.single_csv(file.read())
`

It gave me this error

`---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
in
2
3 with open(csv_nm, mode='rb') as file:
----> 4 spectra, spectra_metadata = prisma.parsers.single_csv(file.read())
5
6 # pd.read_csv(csv_nm)

./PRISMA/prisma/parsers.py in single_csv(bitstream)
76 spectra_data = np.array([np.array(line.split(sep=b','), dtype=float) for line in read_lines[1:] if line.split(sep=b',')[0] != b''])
77
---> 78 indexes = spectra_data.T[0]
79
80

IndexError: index 0 is out of bounds for axis 0 with size 0
`

I used pandas to check that the file was ok and it seemed to be fine. I think there is some compatibility issue.

Thanks,
Jack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant