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

Error on CSV.read attempt #1118

Open
steveo314 opened this issue Dec 6, 2023 · 4 comments
Open

Error on CSV.read attempt #1118

steveo314 opened this issue Dec 6, 2023 · 4 comments

Comments

@steveo314
Copy link

steveo314 commented Dec 6, 2023

Came across an issue when attempting to read a csv file into a Dataframe.

The code:

CSV.read("chuckle/random.csv", DataFrame)

The error:

ERROR: MethodError: Cannot `convert` an object of type Missing to an object of type String

Without setting the quoted= and using this as a csv file:

"Name","Address","CSZ"
"Rachel Smith","123 Main St","Oldtown, NY 12345"
"Herbert "Bert" Jones","564 Second St","Oldtown, NY 12345"
"Joe Brown","879 Fourth St","Oldtown, NY 12345"
@nickrobinson251
Copy link
Collaborator

Does setting quoted=false give you the behaviour you expect? With quote=true (the default), i don't believe this is a valid CSV file.

Sharing a reproducible example would be helpful. At the very least, this is an unhelpful error message -- and it'd be great to improve that -- but i can't replicate it from the info provided.

@mikeingold
Copy link

This Issue came in reference from this conversation on Discourse. I was mainly concerned about this being a suboptimal error message: the core issue is malformed CSV input on a particular line, but the error is due to the immediate internal issue (can’t convert missing to string).

@steveo314
Copy link
Author

@mikeingold does the OP look better now, or should I tweak it more?

@TimG1964
Copy link

The problem in this discourse discussion seems to be related.

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

4 participants