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

Load File From Folder error #141

Open
ngeroki opened this issue Jan 8, 2025 · 1 comment
Open

Load File From Folder error #141

ngeroki opened this issue Jan 8, 2025 · 1 comment

Comments

@ngeroki
Copy link

ngeroki commented Jan 8, 2025

I got error when using Load File from Folder node. Can anyone help me with this issue ?
image

image

@heshengtao
Copy link
Owner

GPT said that the format of your CSV file is incorrect: This error usually occurs when using the pandas library in Python to read CSV files, indicating that a problem was encountered during the parsing of the data. Specifically, Error tokenizing data.C error: Expected 2 fields in line 3, saw 3 means that in the third row of data, pandas expected to see two fields (possibly based on the content of the first two rows), but actually saw three fields.

This problem may be caused by the following several reasons:

Incorrect separator: The separator in the CSV file may not be a comma, but other characters (such as semicolons, tab characters, etc.), or there may be mixed separators in the file.
Incorrectly closed quotation marks: If some fields in a CSV file contain commas and are enclosed in quotation marks, but the quotation marks are not properly closed, this may lead to parsing errors.
Data format inconsistency: Some rows may have more fields than others, resulting in a mismatch in the number of columns.
File encoding issue: Sometimes incorrect file encoding can also cause similar problems.
To solve this problem, you can try the following methods:

Confirm the separator of the CSV file and specify the correct sep parameter in the read_csv function, for example, sep=',' or sep=';'.
Use the error_bad_lines=False parameter to make Pandas skip problematic rows (note that in the new version of Pandas, this parameter has been replaced by on_bad_lines='skip').
Check and correct any formatting errors that may exist in the CSV file, such as ensuring that all referenced fields are properly closed.
If you know which line or lines are incorrect, you can consider manually editing the CSV file to correct these lines, or handle the exception in the code.
Try specifying an encoding format, such as encoding='utf-8' or encoding='latin1', to ensure the file content is read correctly.

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

2 participants