-2

I wanted to know if there's a way to ignore it if the latin1 can't encode and ignore the errors?

This when I'm going to save to a csv file

enter image description here

4
  • 3
    Always provide code as a text, as a minimum reproducible code. For your problem I suggest you reading file first so you can try this answer Commented Jun 14, 2022 at 17:26
  • What's the purpose to use latin1 if this encoding doesn't contain all chars you need? Choose encoding which fits your requirements. Commented Jun 14, 2022 at 17:27
  • I have a system here that only accepts with latin1 Olivin Roght Commented Jun 14, 2022 at 17:39
  • 3
    Why should I not upload images of code/data/errors when asking a question? Commented Jun 14, 2022 at 17:51

1 Answer 1

3

You can pass the keyword argument errors='ignore' to the DataFrame.to_csv method to ignore encoding/decoding errors. More info can be found in the documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

Note: the parameter errors was added since version 1.1.0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.