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

Pandas fails to read some run sheets #14

Open
tashrifbillah opened this issue Jun 13, 2022 · 2 comments
Open

Pandas fails to read some run sheets #14

tashrifbillah opened this issue Jun 13, 2022 · 2 comments

Comments

@tashrifbillah
Copy link
Contributor

tashrifbillah commented Jun 13, 2022

In rc-predict-lochness:

AD00051.Prescient.Run_sheet_eeg_1.csv reading is successful but AD00067.Prescient.Run_sheet_eeg_1.csv fails

File ~/miniconda3/lib/python3.8/site-packages/pandas/_libs/parsers.pyx:805, in pandas._libs.parsers.TextReader.read_low_memory()

File ~/miniconda3/lib/python3.8/site-packages/pandas/_libs/parsers.pyx:861, in pandas._libs.parsers.TextReader._read_rows()

File ~/miniconda3/lib/python3.8/site-packages/pandas/_libs/parsers.pyx:847, in pandas._libs.parsers.TextReader._tokenize_rows()

File ~/miniconda3/lib/python3.8/site-packages/pandas/_libs/parsers.pyx:1960, in pandas._libs.parsers.raise_parser_error()

ParserError: Error tokenizing data. C error: out of memory
@tashrifbillah
Copy link
Contributor Author

Solved by on_bad_lines='skip':

run_sheet_df= pd.read_csv(r, on_bad_lines='skip')

@tashrifbillah
Copy link
Contributor Author

Another solution is to use:
https://github.com/AMP-SCZ/utility/blob/eccb9f842641f49739011d082c7e960dc02918e1/gen_dict_diff.py#L10-L14

pd.read_csv(sys.argv[2], encoding='ISO-8859-1')

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

No branches or pull requests

1 participant