0

I have read a csv file in which there are many values which have been read as unicode. While doing my data processing, I want to skip these values. Existing Code:

if aString.encode('ascii', 'ignore') == b'':
    continue

The same code is working when i am trying this in python environment. But it is not working in script(.py file).

enter image description here

3
  • stackoverflow.com/questions/46154561/… I saw an answer here. Commented Jan 26, 2019 at 14:30
  • Try to just print the string in both envs. Check the diferences. Try again printing the ord number of the character and check differences again. I assume there is some problem on your environment (are you sure that py files are excuted by python3?) Commented Jan 26, 2019 at 17:28
  • 1
    Show a reproducible example of your script. Read and follow minimal reproducible example Commented Jan 26, 2019 at 19:06

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.